O'Reilly logo

C# 4.0 How-To by Ben Watson

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

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

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