title: How does a for each loop guard against an empty list?
body: <p>I read on <a href="http://www.leepoint.net/notes-java/flow/loops/foreach.html" rel="noreferrer">http://www.leepoint.net/notes-java/flow/loops/foreach.html</a>. the for each equivalent to </p>
  
  <pre><code>for (int i = 0; i &lt; arr.length; i++) { 
       type var = arr[i];
        body-of-loop
  }
  </code></pre>
  
  <p>is  </p>
  
  <pre><code>for (type var : arr) {
        body-of-loop
  }
  </code></pre>
  
  <p>My question is how does a for each loop work for an empty list. I know for the regular for loop, the arr.length will just evaluate to 0 and the loop wont execute. What about the for each loop?</p>