- Iterators are simple wrapper classes around references to locations in a container.
- The Iterator class works a bit like a scanner, with methods to check if there is a next token, get the next token, and remove the last token returned.
- Iterable is the generic approach for getting some kind of iterator that will operate on this collection.
- Implementing Iterable is what enables the use of for each syntax.
Computer Sciencenotes on computer science topics on the wiki, for educational and learning purposes
Part of the 2017 CS Study Plan.
Flags · Template:CSFlag · e