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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.