Here you can find the source of hashCode(Object array)
public static int hashCode(Object array)
//package com.java2s; //License from project: Open Source License public class Main { public static int hashCode(Object array) { if (array == null) { return 0; } else if (!array.getClass().isArray()) { return array.hashCode(); } else {// w w w.j a v a 2 s . c om int hashCode = 17; int i; if (array instanceof long[]) { long[] longArray = (long[]) ((long[]) array); for (i = 0; i < longArray.length; ++i) { hashCode = hashCode * 37 + (int) (longArray[i] ^ longArray[i] >> 32); } } else if (array instanceof int[]) { int[] intArray = (int[]) ((int[]) array); for (i = 0; i < intArray.length; ++i) { hashCode = hashCode * 37 + intArray[i]; } } else if (array instanceof short[]) { short[] shortArray = (short[]) ((short[]) array); for (i = 0; i < shortArray.length; ++i) { hashCode = hashCode * 37 + shortArray[i]; } } else if (array instanceof byte[]) { byte[] byteArray = (byte[]) ((byte[]) array); for (i = 0; i < byteArray.length; ++i) { hashCode = hashCode * 37 + byteArray[i]; } } else if (array instanceof double[]) { double[] doubleArray = (double[]) ((double[]) array); for (i = 0; i < doubleArray.length; ++i) { long longBits = Double.doubleToLongBits(doubleArray[i]); hashCode = hashCode * 37 + (int) (longBits ^ longBits >> 32); } } else if (array instanceof float[]) { float[] floatArray = (float[]) ((float[]) array); for (i = 0; i < floatArray.length; ++i) { hashCode = hashCode * 37 + Float.floatToIntBits(floatArray[i]); } } else if (array instanceof boolean[]) { boolean[] booleanArray = (boolean[]) ((boolean[]) array); for (i = 0; i < booleanArray.length; ++i) { hashCode = hashCode * 37 + (booleanArray[i] ? 1 : 0); } } else if (array instanceof char[]) { char[] charArray = (char[]) ((char[]) array); for (i = 0; i < charArray.length; ++i) { hashCode = hashCode * 37 + charArray[i]; } } else { Object[] objectArray = (Object[]) ((Object[]) array); for (i = 0; i < objectArray.length; ++i) { hashCode = hashCode * 37 + hashCode(objectArray[i]); } } return hashCode; } } }