A subclass can inherit "interface" or "implementation" from a superclass. How do inheritance hierarchies designed for inheriting interface, differ from those designed for inheriting implementation (behavioral characteristics of a class)?
Printable View
A subclass can inherit "interface" or "implementation" from a superclass. How do inheritance hierarchies designed for inheriting interface, differ from those designed for inheriting implementation (behavioral characteristics of a class)?
Hi pikkas, it is easy. Class can extend only one superclass, however it can implements several interfaces. Class inherits all superclasses interfaces, as well. Methods defined by interface have public access modifier. Inheriting of interface's implementation follows overriding rules.
Extending interfaces follows same rules as extending of class except interface can extend more than one interface. Note that, java class can extend only one class.