Constructor in Java

Constructor in Java is a special method which is called automatically to initialize an object when the object is created. Need for a constructor When an object is created it is a very common requirement to initialize that object (provide values for its instance variables). To facilitate that a constructor…

Continue reading

Interface in Java

Interface in Java helps to fully abstract the implementation of the class. Interfaces just provide a contract for the class, just providing how the class methods will be accessed by any outside entity without actually providing what methods should do. The class implementing an interface has to provide the behavior…

Continue reading

Abstract Class in Java

Abstract class in Java is a class that is declared using abstract keyword. Abstract class can have regular methods (methods with method body) as well as abstract methods (methods without method body and having abstract specifier). General form of abstract class in Java When is abstract class needed When designing…

Continue reading