Generics

Summary


Generic methods

Basic usage

Set up by putting a type parameter before the method's return type, and use the type parameter name in place of fixed types in the method signature (and definition, if necessary). Example:
 public static < T > void PrintArray( T[] arr )

Upper Bounds of Type Parameters


Generic Classes

Creating a generic class

Using a generic class

Wildcards in Methods that Accept Type Parameters


Deitel Examples -- Chapter 18