| Author |
equals()
|
sandhi mridul
Ranch Hand
Joined: Jan 25, 2008
Posts: 71
|
|
hi, put the correct implementation of hashcode() at line 1. ans- return o; return a+b; return a^b; I am not at all getting what is going on in the above code. need help. Thanks
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
The "hashcode contract" defines a relationship between hashCode and equals. This contract is described in the API under the hashCode method of Object. So the question here is: Given the equals method in this code, what implemention(s) of hashCode would fulfill the contract? Does that help?
|
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
|
 |
 |
|
|
subject: equals()
|
|
|