What is the difference between abstract class and interface ?

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

Posted

in

Tags:

Comments

Leave a Reply