Java的“ for each”循环如何工作?

问题:

Consider: 考虑:

List<String> someList = new ArrayList<String>();
// add "monkey", "donkey", "skeleton key" to someList


for (String item : someList) {
    System.out.println(item);
}

What would the equivalent for loop look like without using the for each syntax? 如果不对_每种_语法使用_for_ ,等效的for循环会是什么样?


解决方案:

参考一: https://stackoom.com/question/MA2/Java的-for-each-循环如何工作
参考二: https://oldbug.net/q/MA2/How-does-the-Java-for-each-loop-work

评论

暂无评论