Comment Re:Java iterators (Score 1) 729
It's because iteration needs to maintain state (namely, where you're up to in the collection). If this was stored on the object, then you wouldn't be able to have 2 iterations active at once. Things like this wouldn't work:
for (Person x: people) {
for (Person y: people) {
System.out.println("Pair (" + x + ", " + y + ")");
}
}
(Ugh, I forgot how to include code in a slashdot comment.)