When I use an object as a key value, is a reference to the object stored in the Map or is an entire new object created and a reference to this new object store in the Map?
Consider the foll.
1. d is a ref. to a Dog object having one
String member variable.
2. I use the above reference as a key in a Map.
3. I now change the value of the above mentioned String variable in such a way that the hashcode also changes (assume that the length of the string variable is the hashcode).
4. Does the position of the object in the Map change as the hashcode has changed? Is the value corresp. to the key now placed in a different 'bucket'?
I would really appreciate if someone could clear my doubts.
Regards
Percy