File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes K&B Chapter 7 Question # 12 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "K&B Chapter 7 Question # 12" Watch "K&B Chapter 7 Question # 12" New topic
Author

K&B Chapter 7 Question # 12

Paras Jain
Ranch Hand

Joined: Feb 26, 2005
Posts: 137
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
SCJP 5.0
Paras Jain
Ranch Hand

Joined: Feb 26, 2005
Posts: 137
I got this corrected by implementing hashCode() method. I have referred to one of the questions asked earlier in the forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: K&B Chapter 7 Question # 12