If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
"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
"There are only 10 types of people in the world: Those who understand binary, and those who don't"
Originally posted by Shiva Mohan:
...But why would i want to change the values i intaialised and make the two bal values(3,3) equal values and compare.
This question is from K&B master exam .Did you mean,for each given option do we need to intailise the values differently and execute...
"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
If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
"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
- We can rule out 'd' because it introduces a new variable, rate. This value is critical in determining whether 2 instances are equal, so if it's not included in the hashCode calculation, then there's no guarantee that the hashCodes for equal instances will be the same. (Note that this is a little different than cases 'a' and 'b', because instances that return the same hashCode are not required to be unequal.)
Originally posted by Henry Wong:
...the last item is actually a bit more subtle, which deserves another mention...
"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
Now, as to why Henry was awake to post at that hour on a Saturday... That's a puzzle.
"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
rubbery bacon. crispy tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|