Worked example
int[][] grid = {{1, 2, 3}, {4, 5, 6}};
for (int r = 0; r < grid.length; r++) {
for (int c = 0; c < grid[r].length; c++) {
System.out.print(grid[r][c] + " ");
}
System.out.println();
}
grid.length is 2 (two rows); each grid[r].length is 3 (three columns). The inner loop prints one row; println() then moves to the next line.