Let’s learn difference between abstract class and interface in java.
Difference between abstract class and interface in java
Here’s the difference between abstract class and interface.
|have instance methods that implements default beahviour.||methods are implicitly abstract. No implementation.|
|may have non final variables.||variables declared are by default public, static and final.|
|members are protected, private etc.||members are public by default.|
|abstract class can be extended using keyword “extends”.||interface can be implemented using keyword “implements”.|
|abstract class can extend another java class and implement multiple interfaces.||interface can only extend another interface.|
|cannot be instantiated. can be subclassed.||absolutely abstract; cannot be instantiated|
Also read – java overview