Java Integer Array Match ArraysMatch(int[] a1, int[] a2)

Here you can find the source of ArraysMatch(int[] a1, int[] a2)

Description

Arrays Match

License

Open Source License

Declaration

public static boolean ArraysMatch(int[] a1, int[] a2) 

Method Source Code

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

public class Main {
    public static boolean ArraysMatch(int[] a1, int[] a2) {
        if (a1 == null || a2 == null)
            return false;
        if (a1.length != a2.length)
            return false;
        for (int i = 0; i < a1.length; i++) {
            if (a1[i] != a2[i])
                return false;
        }//  ww  w .ja  v a2 s .c  o m
        return true;
    }

    public static boolean ArraysMatch(double[] a1, double[] a2) {
        if (a1 == null || a2 == null)
            return false;
        if (a1.length != a2.length)
            return false;
        for (int i = 0; i < a1.length; i++) {
            if (a1[i] != a2[i])
                return false;
        }
        return true;
    }
}