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