An object's hashcode is retrieved whenever any code calls the object's hashCode()
method (such as a collection, container or any other method).
All the classes inherit a basic hash scheme from the fundamental base class
java.lang.Object
, but instead many override this to provide a hash function that better handles their specific data. Classes which provide their own implementation must override the object method public int hashCode().
Ref: java hashCode()