Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • you means the hashcode of object is random integer number. Commented Sep 8, 2015 at 6:29
  • Many people will claim that Object.hashCode will return the address of the object representation in memory. In modern implementations objects actually move within memory. Instead an area of the object header is used to store the value, which may be lazily derived from the memory address at the time that the value is first requested. But this implementation is actually dependent on JVM. So it may differ with each JVM. Commented Sep 8, 2015 at 6:35
  • What I believe is the random number is generated from memory location only and it is used further to locate it. I have updated the answer with proper Javadoc reference for more information. Commented Sep 8, 2015 at 6:42