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

Summary

Section 21.1 Introduction

  • Generic methods enable you to specify, with one method declaration, a set of related methods.

  • Generic classes and interfaces enable you to specify sets of related types.

Section 21.2 Motivation for Generic Methods

  • Overloaded methods are often used to perform similar operations on different types of data.

  • When the compiler encounters a method call, it attempts to locate a method declaration with a name and parameters that are compatible with the argument types in the method call.


  

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