public class Main {
public static void main(String[] args) {
int[][] array = {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9}
};
for (int i = 0; i < array.length; i++) { // Outer loop for rows
for (int j = 0; j < array[i].length; j++) { // Inner loop for columns
System.out.print(array[i][j] + " ");
}
System.out.println(); // Move to the next line after each row
}
}
}
/*
run:
1 2 3
4 5 6
7 8 9
*/