Here you can find the source of equal(boolean[][] a, boolean[][] b)
public static boolean equal(boolean[][] a, boolean[][] b)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static boolean equal(boolean[][] a, boolean[][] b) { if (a.length != b.length) return false; boolean r = true; for (int i = 0; i < a.length; i++) { if (!Arrays.equals(a[i], b[i])) { r = false;//w ww. j av a 2 s .c o m break; } } return r; } public static boolean equal(int[][] a, int[][] b) { if (a.length != b.length) return false; boolean r = true; for (int i = 0; i < a.length; i++) { if (!Arrays.equals(a[i], b[i])) { r = false; break; } } return r; } public static boolean equal(double[][] a, double[][] b) { if (a.length != b.length) return false; boolean r = true; for (int i = 0; i < a.length; i++) { if (!Arrays.equals(a[i], b[i])) { r = false; break; } } return r; } }