2.5 Interface Hierarchies2.4 Class Hierarchies2 Java with Caffeine2.6 Constructors in Derived Classes

2.5 Interface Hierarchies

Not only a Java class may be derived by inheritance from another class but also a Java interface may be derived by inheritance from another interface:  

  interface I extends J
  {
    ...
  }

The derived interface I inherits all the constants and methods declared in the interface J.

Interfaces therefore can form also a tree-like hierarchy as the one for classes shown in the previous section. However, class hierarchies and interface hierarchies are separate and do not overlap.


Interface

Interface and Class Hierarchy
 


An interface cannot be used to derive a class, and a class cannot be used to derive an interface. The only relationship between classes and interfaces is that a class may implement one or more interfaces.


© Wolfgang Schreiner; February 3, 2005

2.5 Interface Hierarchies2.4 Class Hierarchies2 Java with Caffeine2.6 Constructors in Derived Classes