title: How enhanced is enhanced-for loop?
body: <p>I am iterating on the elements of a list of String objects 
  one after the other:</p>
  
  <pre><code>LinkedList list;
  
  // add values to the list here
  
  
  for (int i = 0; i &lt; list.size(); i++)  
      System.out.println(list.get(i));
  </code></pre>
  
  <p>Here, each and every time i invoke get() on list, the list is iterated from one of its ends all the way to the i-th element-- so the complexity of the above loop is O(n^2).</p>
  
  <p>Is is a.) the same as above for enhanced-for loop, or b.) is for-loop maintaining the pointer where it's last have been and thus the complexity of the below loop is O(n)?</p>
  
  <pre><code>for (String s:list)   
      System.out.println(s);
  </code></pre>
  
  <p>If case (b) above -- which i think it is -- is there <strong>any</strong> advantage of using an iterator on the list. this is plain iteration-- there's no going back&amp;forth. EDIT: ..and my list operation is read-only. </p>
  
  <p>TIA. </p>