Abstract Class!
Declaring abstract to a class, may or may not hold abstract methods are called abstract class. They can only be sub-classed but not instantiated. Static methods and fields may be the part of an abstract class. When they are sub-classed, these sub-classes start implementing abstract methods in their parent class. In case if it does not it can be declared under abstract class.
Declaration of the abstract method is completed without an implementation. For example:
abstract void add(int x , int y);

Abstract classes can be used, under following affirmation:
- Sharing the code among the closely related classes
- Declaring non-static fields. This would allow modifying and access to the object states to which they are known
- Classes which have been extended from abstract class should have access modifiers except for public those who had been loaded with multiple methods or fields
Well, it was brief about why are abstract classes used in java...
Hope, you enjoyed reading!
Cheers!