对于Iterable<T> elements;
for(T element:elements){
doSomething();
}
等价于
while(elements.hasNext()){
element = elements.next();
doSomething();
}
对于Iterable<T> elements;
for(T element:elements){
doSomething();
}
等价于
while(elements.hasNext()){
element = elements.next();
doSomething();
}