Abstract class can have abstract methods or it can have implemented methods it gives generalize definition for the class.
So we can inherit abstract class and provide the implementation to that methods as per the requirments
abstract—it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed.An abstract method is a method that is declared without an implementation (without braces, and followed by a semicolon), like this:
If a class includes abstract methods, the class itself must be declaredabstract void moveTo(double deltaX, double deltaY);
abstract, as in:public abstract class GraphicObject {
// declare fields
// declare non-abstract methods
abstract void draw();
}
When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class. However, if it does not, the subclass must also be declared abstract.Suppose if you have a requirement to implement the some common functionality in different modules of the project. But it tedious to code in all the modules, insted you just create an Abstract Class and implement those common functionality and inherit this class whereever applicable and call those methods. You no need to create an object, directly you can call through the class name. Its ease to maintinance.
An abstrct class can contains both methods with and with out implementaion. The Methods which are not having implemetation those are may/may not implemented in derived class.
Adding new methods in abstract class in middle of development life cycle won't break existing sub classes unless these methods are declared as mustoverride.
Abstract class is used when and what methods are used exactly while in interface,the methods are defined for future use.
Benfits:
Core functinality will defined in a single class.
It contains concrete methods.
No need to implement all the methods.
No need to create an object, directly can access through class name.
Can't inherit more than one Abstarct class