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:
I don't think there's any super interface.
When you declare a variable like this:
java.io.Serializable s1 = null;
you haven't created any Object.
Object
The compiler knows that s1 and s2 will implement Serializable and will descend from Object so it allows the equals.
s1
s2
Serializable
equals