Chapter 22. Generics

 

...our special individuality, as distinguished from our generic humanity.

 
 --Oliver Wendell Holmes, Sr.
 

Every man of genius sees the world at a different angle from his fellows.

 
 --Havelock Ellis
 

Born under one law, to another bound.

 
 --Lord Brooke
<feature> <supertitle>Objectives</supertitle>

In this chapter you’ll learn:

<objective>

To create generic methods that perform identical tasks on arguments of different types.

</objective>
<objective>

To create a generic Stack class that can be used to store objects of any class or interface type.

</objective>
<objective>

To understand how to overload generic methods with nongeneric methods or with other generic methods.

</objective>
<objective>

To understand the new() constraint of a ...

Get Visual C# 2010: How to Program, Fourth Edition now with O’Reilly online learning.

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