The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Learning the Java Language
Lesson: Classes and Inheritance

Generics

Generics allow you to define a class or interface once and instantiate it with a variety of types. A generic (also known as a parametrized type) is a type that has one or more type parameters. To use a generic you supply an actual type argument for each type parameter and in doing so constrain the generic type to act only on the argument types.

Defining and Using Generic Types (in the Learning the Java Language trail)

Relationships Among Generics (in the Learning the Java Language trail)

Wildcard Types (in the Learning the Java Language trail)

Defining and Using Generic Methods (in the Learning the Java Language trail)

Using Generics with Legacy Code  (in the Learning the Java Language trail)


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.