Java Array Equal arrayEquals(String[] array1, String[] array2)

Here you can find the source of arrayEquals(String[] array1, String[] array2)

Description

array Equals

License

Open Source License

Declaration

private static boolean arrayEquals(String[] array1, String[] array2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static boolean arrayEquals(String[] array1, String[] array2) {
        if (array1.length != array2.length) {
            System.err.println("Not equal lengths: " + array1.length + "/" + array2.length);
            return false;
        }/*from   w  w w.  j  av a2  s .c o  m*/
        for (int i = 0; i < array1.length; i++) {
            if (!(array1[i].equals(array2[i]))) {
                System.err.println("Not equal: " + array1 + "/" + array2);
                return false;
            }
        }
        return true;
    }
}

Related

  1. arrayEquals(Object[] a, Object[] b)
  2. arrayEquals(Object[] arr1, Object[] arr2)
  3. arrayEquals(Object[] array1, Object[] array2)
  4. arrayEquals(Object[] source, Object target)
  5. arrayEquals(Object[] source, Object target)
  6. arrayEquals(String[] targetMethodParamTypes, String[] paramTypes)
  7. arrayEqualsExceptNull(Object[] a1, Object[] a2)
  8. arrayEqualsSubset(final byte[] array, final int... elements)
  9. arraysAreEqual(double[] a1, double[] a2)