This content has been marked as final. Show 4 replies
Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.
The hashcode of an object has nothing to do with memory addresses. It's simply for data structures that use hashing (like HashMap, HashSet, etc.).
If you put several objects with the same hashcode into a hashing data structure, they will simply be put to the same "bucket".
True, the performance of those data structures is poor if all the elements have the same hashcode (the performance goes from O(1) to O(n)), which is why you want to
have your hashcodes different for non-equal elements. But it's not always possible and there's nothing wrong with that.
Don't post the same question multiple times.
This is the first thread posted. The OP has since been blocked for a month for spamming the forums. All the other threads with the same question have been removed.