-
Rule 2:
the same hashcode values must be produced for any two objects
that are equal (according to the equals method).
-
In practice,
this means that
hashCode
must always return the same value
(e.g., 0)
or it must be written in terms of
some or all of the fields used in the declaration of
equals (and no other fields).