The iterator design pattern is a commonly used pattern that provides a very useful abstraction. The iterator pattern is used to access and traverse the elements of a collection without the need to understand or expose the underlying structure of the collection.
Iterator is a behavioral design pattern in which you use an iterator to enumerate the elements of the container, i.e. the collection, in a sequential manner. Behavioral design patterns are those that manage object collaboration and the delegation of responsibilities among objects.