Possible Duplicate:
How is hashCode() calculated in Java
I found there's no implementation in hashCode()
method of root class Object
in Java:
public native int hashCode();
If I have an Object a
and an Object b
, how can I know the a.hashCode()
and b.hashCode()
value without using System.out.println()
? Just by the hashCode
implementation.
I have try to new
two ArrayList
objects and to my big surprise the hashCode()
values are the same: both of them are 1.