Why cant I use an Iterator this way?
<pre><code>Iterator&lt;String&gt; iterator=...

//right way
for (Iterator&lt;String&gt; i = iterator; i.hasNext(); ){
    System.out.println(i.next());
}

//why can't?
for(String i:iterator){         
}
</code></pre>

<p><strong>Reference:</strong></p>

<p><a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html" rel="nofollow">http://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html</a></p>

<p><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Iterator.html" rel="nofollow">http://docs.oracle.com/javase/6/docs/api/java/util/Iterator.html</a></p>
