Abstract | Interface | |
---|---|---|
method | abstract and concrete | abstract only, support default and static method |
multiple inheritance | no (extend one class) | yes (extends multiple interfaces) |
variables | final, non-final, static and non-static default: declared as public, static, final |
static, final |
implementation | provides interface implementation | doesn't provide abstract class implementation |
constructor | allowed | not allowed |
keyword | abstract (implicit: public, abstract) | interface |
inheritance | implements multiple interfaces but can extend one class |
extends multiple interfaces |
Sunday, April 9, 2017
Abstraction vs Interface
Subscribe to:
Post Comments (Atom)
Abstraction vs Interface
Abstract Interface method abstract and concrete abstract only, support default and static method ...
-
Inheritance is a compile-time mechanism. A super-class can have any number of subclasses. But a subclass can have only one superclass. This...
-
Encapsulation in Java is the mechanism of wrapping data (variables) and code acting on data (methods) together as a single unit. The implem...
No comments:
Post a Comment