- In abstraction there should be at least one method which must be declared but not defined.
- The class that inherit this abstract class need to define that method.
- There must be a abstract keyword that must be return before this class for it to be abstract class.
- This class cannot be instantiated . only the class that implement the methods of abstract class can be instantiated.
Interface Class :
The class that is fully abstract is called interface.
Any class that implement this interface class must use implements keyword and all the methods that are declared in the class must be defined here. otherwise this class also need to be defined as abstract.
Multiple inheritance is possible only in the case of interface.
Difference Between Abstract class and Interface Class:
Abstract class :-
- Abstract class does not support multiple inheritance.
- Abstract contains data member.
- Abstract class contains constructors.
- Only complete member of abstract class can be static.
Interface Class :-
- Interface support multiple inheritance.
- Interface doesn’t contains data member.
- Interface class doesn’t contains constructors.
- Member of Interface can not be static.