how to compare nested array in java
/**
* @author lautturi.com
* Java example: check if the two arrays are deeply equal to one another in java
*/
import java.util.*;
public class Lautturi {
public static void main(String[] args) {
int[][] a = new int[][] {{1}, {2}, {3, 4}};
int[][] b = new int[][] {{1}, {2}, {3, 4}};
int[][] c = new int[][] {{1}, {2}, {3}, {4}};
java.util.Arrays.deepEquals(a, b); // true
java.util.Arrays.deepEquals(b, c); // false
System.out.println(java.util.Arrays.deepEquals(a, b));
System.out.println(java.util.Arrays.deepEquals(b, c));
}
}Source:wwual.wtturi.com