Iterators

Iterators

An iterator is a block of code that supplies all the values to be used in a foreach loop.  A class that represents a collection can implement the System.Collections.IEnumerable interface. This interface requires an  implementation for…