Multiple choice technology programming languages

You can traverse through the elements of many Java Collection objects because they provide a way to access their elements sequentially. What design pattern is used here?

  1. Visitor

  2. Observer

  3. Builder

  4. Proxy

  5. Iterator

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

The Iterator pattern provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation. This is the exact mechanism used by Java Collections. Patterns like Visitor, Observer, Builder, and Proxy serve entirely different architectural purposes.