How hashCode() method in Object class is implemented? [duplicate]
This question already has answers here : Closed 6 years ago . Possible Duplicate: What’s the implementation of hashCode in java Object? While I was browsing through the Object class, I found that there is only a declaration of the hashCode() method. Where is the implementation part? If there is no implementation how does the hashCode() method return me a result? It's implemented in the native code. As for implementation, it's a bit more tricky - you can alter default implementation. If you look at the "Open JDK" sources you will see the following options: -XX:hashCode=n (from 0 to 5). 0 – Park