Saturday, February 22, 2014

Get Original HashCode

In a class, where hashcode() has been overridden, we can still get the actual system generated hashcode of the object using  :
System.identityHashcode(object)
How this info can be useful? when the hashcode() differs from SystemIdentityHashCode() it probably means that the equivalence of the objects is not determined by the memory and has its own implementation.

No comments: