How can I change the following code so it prints out:
123
123
123
instead?
public class A4SXYY {
public static void main(String[] args) {
int[][] a2 = new int[3][3];
for (int i = 0; i < a2.length; i++) {
for (int j = 0; j < a2[i].length; j++) {
a2[i][j] = i + 1;
System.out.print(" " + a2[i][j]);
}
System.out.println("");
}
}
}