Sr. | Abstract Class | Interface |
1 | Abstract class can contain abstract methods, concrete methods or both | Interface contains only abstract methods |
2 | Except private we can have any access specifier for methods in abstract class. | Access Specifiers for methods in interface must be public |
3 | Except private variables can have any access specifiers | Variables defined must be public , static , final |
4 | We cannot achieve multiple inheritance using abstract class. | Multiple Inheritance in java is implemented using interface |
5 | An abstract class can be extended using keyword “extends” | To implement an interface we use implements keyword |
Leave a Reply