Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

K&B Chapter 7 Question # 12

 
Paras Jain
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have fixed the code as suggested by the question and implemented the equals method as follows



Even now I am getting 5 as the answer. Please tell me what is wrong
 
Paras Jain
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got this corrected by implementing hashCode() method. I have referred to one of the questions asked earlier in the forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic