title: For each loop using 2D array
body: <p>This is the snippet of Java code:</p>
  
  <pre><code>int[][] uu = new int[1][1];
  uu[0][0] = 5;
  for(int[] u: uu){
      System.out.println(u[0]);
  }
  </code></pre>
  
  <p>It prints 5. But why does the declaration part of for loop is declared <code>as int[] u</code>, but not <code>as int[][] u</code>?</p>
  
  <p>At the uu you reference 2D array...
  That is not a homework. I am preparing for Java certification.
  Cheers</p>