Here you can find the source of arraysEqual(Object[] array1, Object[] array2)
public static boolean arraysEqual(Object[] array1, Object[] array2)
//package com.java2s; //License from project: Apache License public class Main { public static boolean arraysEqual(Object[] array1, Object[] array2) { if (array1.length != array2.length) { return false; }// w w w. j a v a2 s . com for (int i = 0; i < array1.length; ++i) { if (!array1[i].equals(array2[i])) { return false; } } return true; } public static boolean arraysEqual(byte[] array1, byte[] array2) { if (array1.length != array2.length) { return false; } for (int i = 0; i < array1.length; ++i) { if (array1[i] != array2[i]) { return false; } } return true; } }