集合

48 阅读1分钟

for循环: for-each

for(int i : myNumbers);

等价于

for(int i = 0; i < myNumbers.size(); i++) {
    int j = myNumbers.get(i);
}