This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Altering Object's hashcode ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Altering Object Watch "Altering Object New topic
Author

Altering Object's hashcode ...

Brian Lugo
Ranch Hand

Joined: Nov 10, 2000
Posts: 165
What causes an Object's hashcode to be altered.
I came across this in ExamPrep book with refrence to Hashtable. The author says:
-- Don't alter an object stored in a Hashtable, if the modification affects the hashcode. If you have to alter an object, remove it from the table, modify it, and then put it back. --
Thanks,
Brian
Brian Lugo
Ranch Hand

Joined: Nov 10, 2000
Posts: 165
Nevermind,
I guess this may be in reference to the classes
that implement their own hashcode method by overriding Object/Parent class hashcode method.
Brian
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Altering Object's hashcode ...
 
Similar Threads
Why is " == " on different strings with same content is returning "false"
why we need to override equals and hascode
hashcode() contract
null key in a HashMap
Hashcode