Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 22. Generics

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial