Interface | Abstract Class |
---|---|
Interface contains only abstract methods | Abstract class can contain abstract methods, concrete methods or both |
Access Specifiers for methods in interface must be public | Except private, we can have any access specifier for methods in abstract class |
Variables defined must be public, static, final | Except private variables can have any access specifiers |
Multiple Inheritance in java is implemented using interface | We cannot achieve multiple inheritance using abstract class |
To implement an interface, we use implements keyword | To create abstract class, we extend abstract class |
Leave a Reply