O'Reilly logo

C# 2010 for Programmers, Fourth Edition by Harvey M. Deitel, Paul J. 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

22. Generics

Objectives

In this chapter you’ll learn:

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

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

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

• To understand the new() constraint of a type parameter.

• To apply multiple constraints to a type parameter.

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

Outline

22.1 Introduction

22.2 Motivation for ...

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