Main reason for the existence of interfaces in Java is: to support multiple inheritance. Languages supporting multiple implementation inheritance, an interface is equivalent to a fully abstract class (a class with only public abstract members).
The above differentiation suggests when to use an abstract class and when to use an interface:
In general, prefer interfaces if you don't need to use an abstract class, because they provide more design flexibility.
|
Recommend the tutorial |


Ask Questions? Discuss: Interface Vs Abstract Class View All Comments
Post your Comment