O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Nongeneric Collection Types

Before delving into the generic collection types, it’s useful to get an idea of the legacy collection types out there in the System.Collections namespace. As you learned in the “Life Without Generics” section in Chapter 15, the only way you could create maximally applicable types in the past was to use System.Object, the mother type of all types, somewhere. The nongeneric collection types do so for their storage and hence bubble up System.Object to the type’s surface on methods like Add, Remove, and so on. The main reason to learn about those types is for survival purposes (when, for example, facing code that was written before the introduction of generics). For fresh code, generic collection types are the right choice. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required