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 the GetEnumerator()method  which returns an IEnumerator interface. The IEnumerator interface has a Current property which contains the Read more