This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I have written a class Person and overridden equals and hashcode methods. But while adding Person objects to HashSet I am able to add duplicates. So it seems my implementation of equals/hashcode is not correct.
Can someone please tell me where I am doing wrong?
At line 1 I am getting HashSet size as 4 instead of 3!!!