Вот пример использования Arrays.deepEquals
:
import java.util.Arrays;
class DeepEqualsTest {
public static void main(String[] args) {
int a1[][] = new int[][]{ {1,2,3}, {4,5,6} };
int a2[][] = new int[][]{ {1,2,3}, {4,5,6} };
if (Arrays.deepEquals(a1, a2)) {
System.out.println("Arrays are equal");
}
else {
System.out.println("Arrays are not equal");
}
}
}