From charlesreid1

Revision as of 00:51, 26 June 2017 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

See Iterators vs Iterable

Iterators

  • 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

  • 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.





See also: