1for (int row = 0; row < arr.length; row++)//Cycles through rows
2{
3 for (int col = 0; col < arr[row].length; col++)//Cycles through columns
4 {
5 System.out.printf("%5d", arr[row][col]); //change the %5d to however much space you want
6 }
7 System.out.println(); //Makes a new row
8}
9//This allows you to print the array as matrix
1int[][] array = new int[rows][columns];
2System.out.println(Arrays.deepToString(array));
3
1static void debugV2(Object... obj) {
2 System.out.println(Arrays.deepToString(obj)
3 .replace("],", "\n").replace(",", "\t")
4 .replaceAll("[\\[\\]]", " "));
5 }
6
7 static void debug(Object... obj) {
8 System.err.println(Arrays.deepToString(obj).replace("], ", "]\n"));
9 }