Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

K&B Chapter 7 Question # 12  RSS feed

 
Paras Jain
Ranch Hand
Posts: 140
  • 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: 140
  • 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
Boost this thread!