Here you can find the source of arrayEquals(Object[] array1, Object[] array2)
static boolean arrayEquals(Object[] array1, Object[] array2)
//package com.java2s; //License from project: Apache License public class Main { static boolean arrayEquals(Object[] array1, Object[] array2) { if (array1.length != array2.length) { return false; }//from ww w . ja va2 s . c o m for (int i = 0; i < array1.length; i++) { if (!equals(array1[i], array2[i])) { return false; } } return true; } static boolean equals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } if (o1 == null || o2 == null) { return false; } if (o1.getClass().isArray() && o2.getClass().isArray()) { return arrayEquals((Object[]) o1, (Object[]) o2); } return o1.equals(o2); } }