Chapter 10. Collections and Generics

The most primitive container within the .NET platform is the System.Array type. As you have seen over the course of the previous chapters, C# arrays allow you to define a set of identically typed items (including an array of System.Objects, which essentially represents an array of any types) of a fixed upper limit. While this will often fit the bill, there are many other times where you require more flexible data structures, such as a dynamically growing and shrinking container, or a container that can hold only items that meet a specific criteria (e.g., only items deriving from a given base class, items implementing a particular interface, or whatnot). To begin understanding the task of building flexible and ...

Get Pro C# 2008 and the .NET 3.5 Platform, Fourth Edition now with O’Reilly online learning.

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