Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
9.1.3 Superinterfaces
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:
- K is a direct superinterface of I.
- There exists an interface J such that K is a superinterface of J, and J is a superinterface of I, applying this definition recursively.
Interface I is said to be a subinterface of interface K whenever Kis a superinterface of I.