Lecture overview -- Keyboard shortcut: 'u'  Previous page: The Iterator Design Pattern -- Keyboard shortcut: 'p'  Next page: Iterator blocks and yield return -- 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    Collection Classes - slide 35 : 36

Making iterators with yield return
The yield return statement can be used to define iterators (enumerators) in an easy, high-level fashion
simple.cs
A collection of up to three instance variables of type T - with an iterator.
client.cs
A sample iteration of the three instance variable collection.
Go to exercise
The iterator behind a yield
Sequence.cs
The abstract class IntSequence - Revisited.
Sequence.cs
The class IntInterval - Revisited.
Sequence.cs
The class IntSingular - Revisited.
Sequence.cs
The class IntCompSeq - Revisited.
App.cs
An application of the integer sequences.
output
Output of the integer sequence application program.
farm.cs
Animalfarm - GetGroup with yield return.
prog.cs
A sample client of AnimalFarm.
output
Program output.