Please enable JavaScript.
Coggle requires JavaScript to display documents.
Java Abstract Classes vs Interfaces - Coggle Diagram
Java Abstract Classes vs Interfaces
Instance Method Types
Abstract Class
Abstract methods
Non-abstract methods
Interface
Abstract methods
Default methods
Inheritance
Abstract Class
Can extend regular class
Can extend abstract class
Can extend only one class
Interface
Can extend interface
Can extend any number of interfaces
Allowed variables
Abstract class
Final
Non-final
Static
Non-static
Interface
Static
Valid Implementation
Abstract class
Can implement an interface
Interface
Cannot implement an abstract class
Constructor
Abstract class
Can have a constructor
Interface
Cannot have a constructor
Intended use
Abstract class
To provide a base class with common members
Interface
To decouple the interface of a class from the implementation.
By epillado
bio.site
LinkedIn