Last Updated: June 6, 2026
Every for (Item item : cart) loop has something underneath it walking the collection. That something is an Iterator. This lesson covers what Iterable and Iterator actually are, how the cursor moves, why removing items during a loop is easy to get wrong, how ListIterator extends the basic model with backward movement and positional updates, and how to make a custom class iterable so a for-each loop works on it.