Java Integer Array Create intArraysAreEqual(int array1[], int array2[])

Here you can find the source of intArraysAreEqual(int array1[], int array2[])

Description

Test if two int arrays are equal.

License

Open Source License

Declaration

public static boolean intArraysAreEqual(int array1[], int array2[]) 

Method Source Code

//package com.java2s;
//   it under the terms of the GNU General Public License as published by

public class Main {
    /**/*from w  ww .ja  va 2s  . c  om*/
     * Test if two int arrays are equal.
     */
    public static boolean intArraysAreEqual(int array1[], int array2[]) {
        int i, n;
        if (array1 == null)
            return (array2 == null);
        n = array1.length;
        if (n != array2.length)
            return false;
        for (i = 0; i < n; i++) {
            if (array1[i] != array2[i])
                return false;
        }
        return true;
    }
}

Related

  1. intArrayContains(int[] array, int key)
  2. intArrayEquals(int[] a1, int[] a2)
  3. intArrayFromString(final String data)
  4. intArrayFromString(String record)
  5. intArrayMin(int[] arr)
  6. intArraySet(int arr[], int val)