Abstract vs Interface (Java)
Abstract | Interface | |
Declaration keyword | abstract | interface |
Objects can be created? | No | No |
Contains Abstract and concrete methods? | Both | Only Abstract methods |
Are any keywords required for methods? | Abstract methods required to mention abstract keyword | Not required |
Contain any Constructors? | Yes | No |
inheritance | An abstract class can extend only from other abstract class | Interfaces can extend only to other interfaces |
number of inheritances possible | Only 1 | many |
Types of modifiers can be used | final, non-final, static, non-static | final, static |