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