|
Sun's official document TJLS (The Java Language Specification)! Among them, Chapter 9 Section 9.2 has such a paragraph about the interface:
If an interface has no direct superinterfaces, then the interface implicitly
declares a public abstract member method m with signature s, return type r,
and throws clause t corresponding to each public instance method m with
signature s, return type r, and throws clause t declared in Object, unless a
method with the same signature, same return type, and a compatible throws
clause is explicitly declared by the interface. It is a compile-time error if the
interface explicitly declares such a method m in the case where m is declared to
be final in Object.
The interface implicitly defines a set of methods that are exactly the same as the method signatures in the Object class; if the interface defines one that is defined as final in the Object, a compilation error will occur. |
|