Jelle Klap wrote:If you need to override hashCode(), but for some reason still want to get the result that the Object.hashCode() implementation would have returned, you can use System.identityHashCode() for that.
Wasn't even aware of this one. Thanks for sharing.
Have a cow! Moo!
santhosh kumar vk wrote: I have overridden HashCode and Equals method when i print the hashcode it is returning hashcode that mean whatever i created , Could you please tell me how to get the original hashcode created by JVM.
Question: Why do you think you need to know this?
The whole reason for overriding hashCode() is to make it compatible with equals(), which you should always do anyway. And if you really need to store Objects individually, you have IdentityHashMap; but its uses are rare, so if you find yourself thinking you need it, you might want to make sure you really need to.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop