Java Array HashCode implementation

The java.lang.Array hashCode method is inherited from Object, which means the hashcode depends on the reference. To get the hashcode based on the content of the array use Arrays.hashCode.

Beware though its a shallow hashcode implementation. A deep implementation is also present Arrays.deepHashCode.

Leave a Comment