O'Reilly logo

Visual C#® 2012: How to Program, Fifth Edition by Harvey Deitel, Paul Deitel

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

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

Objectives

In this chapter you’ll:

• Create generic methods that perform identical tasks on arguments of different types.

• Create a generic Stack class that can be used to store objects of most types.

• Understand how to overload generic methods with nongeneric methods or with other generic methods.

• Understand the kinds of constraints that can be applied to a type parameter.

• Apply multiple constraints to a type parameter.

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