Here you can find the source of equal(int[] a, int[] b)
Parameter | Description |
---|---|
a | the first array |
b | the second array |
public static boolean equal(int[] a, int[] b)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**/*w ww . ja v a 2 s . c om*/ * Checks if a[i] == b[i] for all i from 0 to a.length (= b.length) * @param a the first array * @param b the second array * @return true if a[i] == b[i] for all i from 0 to a.length (= b.length), false otherwise */ public static boolean equal(int[] a, int[] b) { return Arrays.equals(a, b); } /** * Checks if a[i] == b[i] for all i from 0 to a.length (= b.length) * @param a the first array * @param b the second array * @return true if a[i] == b[i] for all i from 0 to a.length (= b.length), false otherwise */ public static boolean equal(boolean[] a, boolean[] b) { return Arrays.equals(a, b); } /** * Checks if a[i] == b[i] for all i from 0 to a.length (= b.length) * @param a the first array * @param b the second array * @return true if a[i] == b[i] for all i from 0 to a.length (= b.length), false otherwise */ public static boolean equal(double[] a, double[] b) { return Arrays.equals(a, b); } }