Abstract class:
1. An abstract class is written when there are some common features shared by all the object.
2. When an abstract class is written, it is the duty of the programmer to provide subclasses to it.
3. An abstract class contains some abstract method and also a concrete method.
4. An abstract class can contain instance variables also.
5. An abstract class is declared by using the keyword “abstract”.
Interface :
1. An interface is written when all the features are implemented different object.
2. An interface is written when the programmer wants to leave the implementation to the third party vendors.
3. An interface class contains only abstract method.
4. An interface class cannot contain instance variables. It contains only constants.
5. Interface class is declared by using the keyword “interface”.
Question and answer is powered by AnsPress.io