If an extends
clause is provided, then the interface being declared extends each
of the other named interfaces and therefore inherits the methods and constants of
each of the other named interfaces. These other named interfaces are the direct
superinterfaces of the interface being declared. Any class that implements
the
declared interface is also considered to implement all the interfaces that this interface extends
and that are accessible to the class.
ExtendsInterfaces:
extends
InterfaceType
ExtendsInterfaces,
InterfaceType
The following is repeated from §4.3 to make the presentation here clearer:
InterfaceType:
TypeName
Each InterfaceType in the extends
clause of an interface declaration must name an accessible interface type; otherwise a compile-time error occurs.
A compile-time error occurs if there is a circularity such that an interface directly or indirectly extends itself.
There is no analogue of the class Object
for interfaces; that is, while every class is an extension of class Object
, there is no single interface of which all interfaces are extensions.
The superinterface relationship is the transitive closure of the direct superinterface relationship. An interface K is a superinterface of interface I if either of the following is true:
Interface I is said to be a subinterface of interface K whenever K is a superinterface of I.