Chapter 7. Iterators

Stacks, queues, dictionaries, dynamic arrays, normal arrays, and various other collections were introduced in previous chapters. Collections are assemblages of related types. There could be a dynamic array of Employee types, which would include HourlyEmployee, ExemptEmployee, and CommissionedEmployee instances. There could be a queue of bank requests, such as DepositTransaction, WithdrawalTransaction, and InterestTransaction types. Inheritance relates these types at compile time, whereas polymorphism binds them at run time. Collections are also assemblages of similar items. Enumerating the elements of a collection is a recurrent and valuable ...

Get Programming Microsoft® Visual C#® 2005: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.