What's the difference between an Abstract Class and Interface in Java?
What's the difference between an Abstract Class and Interface in Java ?
113106-Sep-2019
Updated on 06-Sep-2019
Home / DeveloperSection / Forums / What's the difference between an Abstract Class and Interface in Java ?
What's the difference between an Abstract Class and Interface in Java?
Anonymous User
06-Sep-2019That is the basic difference between an abstract class and interface is that an interface can only possess a declaration of public static methods with no concrete implementation. While an abstract class may have members with any access specifiers (public, private, etc.) with or without a concrete implementation.
A primary difference is the use of abstract classes and interfaces is that a class which implements an interface must implement all the methods of the interface while a class which inherits from an abstract class doesn't require the implementation of all the methods of its superclass.
The class can implement multiple interfaces but it can extend only one abstract class.