Adolfo Eloy
Software Developer
OCPJP 6
OCPJP 95%
Rikesh Desai wrote:
There seems to be some issue with the hashcode only, but cant seem to figure out what it could be.![]()
OCPJP 95%
so the hashcode is returning the same value so they are being placed in the same bucket.
Then how is it that first is calling the equals method and the second one isnt?
Adolfo Eloy
Software Developer
OCPJP 6
Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
OCPJP 95%
OCPJP 95%
OCPJP 95%
understand? actually Lester said correctly that *The code is broken*
OCPJP 95%
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Rikesh Desai wrote:why is equals being called in the first case?
![]()
Rikesh Desai wrote:
so the hashcode is returning the same value so they are being placed in the same bucket.
Then how is it that first is calling the equals method and the second one isnt?
Rikesh Desai wrote:
in first case hashcode is :
String length of "long board" : 10
String length of "aoag aoara" : 10
Integer : 10
in second case hashcode is :
String length of "rufus" : 5
String length of "auaus" : 5
Integer: 10
Lester Burnham wrote:The code is broken. What is the point of second-guessing the class libraries how they might manifest that fact?
OCPJP 95%
This is my favorite tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|