This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
this is taken from the SCJP 5 book, Page626, Qn 7:
As the code stands, I understand it outputs "3".
But I don't understand why hashCode() is uncommented, it outputs "2"?
Based on "THIS LINE" of code, t1.equals(t2) should be false, because it is comparing their "day" using "==", not "equals()". Then based on this logic, t2's value should not replace t1's. then there will be 3 mappings in the map. Where is my understanding wrong? Thanks.