Internal Iterator
n
Server controls iteration
n
// This is C#
n
List list=new List();
n
foreach (Element element in list)
n
element.Process();
With an internal iterator, the client code does not control the iteration.
Here something unseen is calling Next() and CurrentItem(), but we’ll see shortly that C# really uses an external iterator behind the scenes.