title: why is the enhanced for loop more efficient than the normal for loop
body: <p>I read that the <em>enhanced for loop</em> is more efficient than the normal <em>for loop</em> here:</p>
  
  <p><a href="http://developer.android.com/guide/practices/performance.html#foreach" rel="noreferrer">http://developer.android.com/guide/practices/performance.html#foreach</a></p>
  
  <p>When I searched for the difference between their efficiency, all I found is: In case of normal for loop we need an extra step to find out the length of the array or size etc.,</p>
  
  <pre><code>for(Integer i : list){
     ....
  }
  
  
  int n = list.size();
  for(int i=0; i &lt; n; ++i){
    ....
  }
  </code></pre>
  
  <p>But is this the only reason, the enhanced for loop is better than the normal for loop?  In that case better use the normal <em>for loop</em> because of the slight complexity in understanding the enhanced <em>for loop</em>.</p>
  
  <p>Check this for an interesting issue: <a href="http://www.coderanch.com/t/258147/java-programmer-SCJP/certification/Enhanced-Loop-Vs-Loop" rel="noreferrer">http://www.coderanch.com/t/258147/java-programmer-SCJP/certification/Enhanced-Loop-Vs-Loop</a></p>
  
  <p>Can any one please explain the internal implementation of these two types of for loops, or explain other reasons to use the enhanced <em>for loop</em>?</p>