Chapter 6. Introduction to Generics


Generics are a feature new to C# 2.0 that adds a tremendous amount of power and flexibility to object-oriented programming using the language. Many definitions of generics start off with a comparison of template-based programming in C++, but I feel that does generics an injustice.

Generics allow class designers to defer the specification of types within a class definition until such time as that class is instantiated. This chapter not only shows you how to use generics, but gives you a good idea of when you should use generics and how they can create drastic performance improvements and make code reuse significantly easier. ...

Get Microsoft® Visual C# 2005 Unleashed now with O’Reilly online learning.

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