|
Hey, abc123.
Hashcode and equals are both used for comparison purposes. If you were to store a collection of objects in a Hashtable (or Hashmap), the hashcode method would be used to calculate the hash values.
They go hand in hand. If objects a1 and a2 are equal, a1.hashcode() == a2.hashcode() must be true.
Beyond that, I don't really know the details.
|