posted 14 years ago
How does equals work at the low level?
I take this to mean "If I don't override the equals(Object) method from the Object class then how does equals() work for my class?"
In that case the equals() method from Object is used. And that method returns true if the two objects being compared are the same object, and false if they are different objects.
In your example you are comparing two different objects, so the equals() method returns false.
And no, declaring a hashCode method has no effect on the result of equals().