Here you can find the source of equals(double[][] xs, double[][] ys)
equals(xs[i],ys[i])
is true
public static boolean equals(double[][] xs, double[][] ys)
//package com.java2s; import java.util.*; public class Main { /**//from w w w . j ava 2 s. c o m * Tests two double[][] arrays for having equal contents. * @return true iff for each i, <code>equals(xs[i],ys[i])</code> is true */ public static boolean equals(double[][] xs, double[][] ys) { if (xs == null) return ys == null; if (ys == null) return false; if (xs.length != ys.length) return false; for (int i = xs.length - 1; i >= 0; i--) { if (!Arrays.equals(xs[i], ys[i])) return false; } return true; } /** * Tests two boolean[][] arrays for having equal contents. * @return true iff for each i, <code>Arrays.equals(xs[i],ys[i])</code> is true */ @SuppressWarnings("null") public static boolean equals(boolean[][] xs, boolean[][] ys) { if (xs == null && ys != null) return false; if (ys == null) return false; if (xs.length != ys.length) return false; for (int i = xs.length - 1; i >= 0; i--) { if (!Arrays.equals(xs[i], ys[i])) return false; } return true; } }