title: Using Iterable to iterate over an ArrayList?
body: <p>We all know this piece of code:</p>
  
  <pre><code>ArrayList&lt;String&gt; str1 = new ArrayList&lt;String&gt;();
  for(String str: str1) {
      // code goes here
  } 
  </code></pre>
  
  <p>This enhanced-for loop uses an Iterable instead of <code>Iterator</code> to traverse. But I didn't see that <code>ArrayList</code> extends <code>Iterable</code>. Could anyone tell me why this can happen?</p>