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