Viorel is correct. You would learn more by doing a little research before asking such broad questions. You might start with the
API, looking at the documentation for hashCode() in java.lang.Object. This is where the "hashCode contract" is described. Next, do a little reading on collections that use "hashing." These are easy to identify because they have the
word "hash" in their names, for example, HashSet and HashMap.
With that background, you will be ready to ask more specific questions and we can help you with the details.