Chapter 6. Introduction to Generics

IN THIS CHAPTER

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 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.