Which design pattern is used to provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation?

  • Decorator
  • Iterator
  • Observer
  • Proxy
The Iterator design pattern is used to provide a way to access elements of an aggregate object sequentially without exposing its underlying representation. It abstracts the traversal mechanism and allows the client to access elements without knowing the internal structure.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *