Navigating Sequences with Enumerations and Iterators

Navigating Sequences with Enumerations and Iterators

Enumeration

An enumerator is a cursor that traverses a sequence of values. An enumerator is forward only as well as being read-only. To qualify as an enumerator, the class must implement the IEnumerator or IEnumerator<T> (Generic) interfaces.

Certain control constructs, such as the foreach statement, make use of enumerable objects.