Chapter 9. Generics

Generics are a way to declare types, interfaces, delegates, and methods in a type-agnostic way. For example, IComparable<T> defines an interface that specifies a comparison between objects of type T. The T is defined by you where needed.

One of the most common ways to use generics is in collection classes. Before generics, the ArrayList was commonly used to ...

Get C# 4.0 How-To now with O’Reilly online learning.

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