posted 15 years ago
Shivendra,
equals method will return false for two objects with filed values "aa" , "bb", "cc" and "bb", "aa", "cc" and hashcode for them will return different values, which is perfectly legal. I am not sure how the implementation of hashcode() method is invalid. It would be great if someone could provide a example where equals() will return true but hascode() for those two objects will return different values.
Output of following code returns -
false
hello
world