Currently I am studying for my Java test. Whist studying I've come across a small problem.
In this for loop:
for ( int i=1; i <= 3 ; i++ ) {
for (int j=1; j <= 3 ; j++ ) {
System.out.println( i + " " + j );
}
}
The output is:
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3
My problem is, I don't understand it. When I read this code I keep thinking it should look like this:
1 1
2 2
3 3
Why is this not the case?