Salin Array di Java 2D
int[][] copy = Arrays.stream(matrix).map(int[]::clone).toArray(int[][]::new);
Zalven
int[][] copy = Arrays.stream(matrix).map(int[]::clone).toArray(int[][]::new);
//say you have boolean[][] foo;
boolean[][] nv = new boolean[foo.length][foo[0].length];
for (int i = 0; i < nv.length; i++)
nv[i] = Arrays.copyOf(foo[i], foo[i].length);