Iterator<String> iterator=...
//right way
for (Iterator<String> i = iterator; i.hasNext(); ){
System.out.println(i.next());
}
//why can't?
for(String i:iterator){
}
参照:
http://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html
http://docs.oracle.com/javase/6/docs/api/java/util/Iterator.html