The members of an interface type are:
-
Members declared in the body of the interface (§9.1.4).
-
Members inherited from any direct superinterfaces (§9.1.3).
-
If an interface has no direct superinterfaces, then the interface implicitly declares a
publicabstractmember methodmwith signature s, return type r, andthrowsclause t corresponding to eachpublicinstance methodmwith signature s, return type r, andthrowsclause t declared inObject(§4.3.2), unless anabstractmethod with the same signature, same return type, and a compatiblethrowsclause is explicitly declared by the interface.It is a compile-time error if the interface explicitly declares such a method
min the case wheremis declared to befinalinObject.It is a compile-time error if the interface explicitly declares a method with a signature that is override-equivalent (§8.4.2) to a
publicmethod ofObject, but which has a different return type, or an incompatiblethrowsclause, or is notabstract.
The interface inherits, from the interfaces it extends, all members of those interfaces, except for (i) fields, classes, and interfaces that it hides, (ii) abstract methods and default methods that it overrides (§9.4.1), (iii) private methods, and (iv) static methods.
Fields, methods, and member types of an interface type may have the same name, since they are used in different contexts and are disambiguated by different lookup procedures (§6.5). However, this is discouraged as a matter of style.