Every class inherits Object class so as your class "MyClass" does; You class inherits Object(daddy of all classes) class's equals() method whose definition is as following:
public boolean equals(Object o) { return this==o; }
So when you do like if(a.equals(b)) { } a and b are objects of MyClass, so where Object is required as Argument any object of Java can fit there.
It compiles fine and gives the print in else part. The parent class for all classes in java is java.lang.Object class got default implementation for equals method.
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?