Lecture overview -- Keyboard shortcut: 'u'  Previous page: Sample use of IComparable -- Keyboard shortcut: 'p'  Next page: Sample use of IFormattable -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home    Abstract classes, Interfaces, and Patterns - slide 16 : 37

Sample use of IEnumerator and IEnumerable
The interface IEnumerator in System.Collections is used as the basis for iteration with foreach
IEnumerable.cs
A reproduction of the interface IEnumerable.
IEnumerator.cs
A reproduction of the interface IEnumerator.
Interval.cs
IEnumerator in the type Interval.
app_1.cs
Iteration with and without foreach based on the enumerator.
The interface IEnumerable prescribes an operation GetEnumerator that returns an enumerator of type IEnumerator