title: Uses of 'for' in Java
body: <p>I am fairly new to Java and in another Stack Overflow question about <a href="https://stackoverflow.com/questions/1241946/how-is-a-for-loop-structured-in-java">for loops</a> an answer said that there was two uses of for in Java:</p>
  
  <pre><code>for (int i = 0; i &lt; N; i++) {
  }
  
  
  for (String a : anyIterable) {
  }
  </code></pre>
  
  <p>I know the first use of for and have used it a lot, but I have never seen the second one. What is it used to do and when would I use it? </p>