I got this code from SCJPjava 5 written by Kathy Sierra.
My problem starts on the line commented as lines of doubt.
In the book it is written that after d1.name ="magnolia"; is done the invocation of m.get(d1); should give null as the hashcode method fails, but when I run this code it gives the d1 keys value. In the next invocation m.get(new Dog("clover")); it should give me the matching key value i.e Dog Key, but it gives null.
Aren't the equal & hashcode methods working . What do this methods actually do.
Please help me, Thank you for help in advance.