Uses of 'for' in Java
I am fairly new to Java and in another Stack Overflow question about [for loops][1] an answer said that there was two uses of for in Java:

    for (int i = 0; i < N; i++) {
    }
    
    
    for (String a : anyIterable) {
    }

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? 


  [1]: http://stackoverflow.com/questions/1241946/how-is-a-for-loop-structured-in-java
Uses of 'for' in Java
===

I am fairly new to Java and in another Stack Overflow question about [for loops][1] an answer said that there was two uses of for in Java:

    for (int i = 0; i < N; i++) {
    }
    
    
    for (String a : anyIterable) {
    }

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? 


  [1]: http://stackoverflow.com/questions/1241946/how-is-a-for-loop-structured-in-java