So we all know that all classes implicitly extend Object. How about interfaces? Is there an implicit super-interface? I say there is. The following code compiles:
java.io.Serializable s1 = null;
java.io.Serializable s2 = null;
s1.equals(s2);
The equals method is not declared in Serializable, but in Object. Since interfaces can only extend other interfaces, and Object is a class, not an interface, there must be some implicit interface that is being extended. And the Object class must then implicitly implement this implicit interface (wow, that was weird to write).
So, the question is, how correct is this?
No. Citing the Java Language Specification:
The difference between this and your “implicit super interface” is that
Objecthas a number of final and protected methods, and you couldn’t have those modifiers in an interface.