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++ ) {
Every time you nest for loops (that's what it's called when you put one inside of another), it basically adds another "dimension". If you have a single for loop, it's like a straight line. So, if our first loop is from 1 to 5 it would be:
1 2 3 4 5
If you add a second loop, (lets say 1-3) (You read top to bottom left to right, first number represents the first variable, etc)
11 21 31 41 51
12 22 32 42 52
13 23 33 43 53
And if you add a third loop (let's say 1-2) (I obviously can't make 3 dimensions here, so bear with me)
111 211 311 411 511 || 112 212 312 412 512
121 221 321 421 521 || 122 222 322 422 522
131 231 331 431 531 || 132 232 332 432 532
So, the total number of iterations (how many times you go through the loops) is the product of the loops. This one is a 3 * 5 * 2, so it will iterate 30 times.