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

Trail: Bonus

Lesson: Generics

by Gilad Bracha


Note: This lesson covers a language feature introduced in the latest release of the JavaTM 2 Platform Standard Edition version 5.0. Visit the J2SE 5.0 download page.
Introduced in J2SE 5.0, this long-awaited enhancement to the type system allows a type or method to operate on objects of various types while providing compile-time type safety. It adds compile-time type safety to the Collections Framework and eliminates the drudgery of casting.
Introduction (in the Bonus trail)

Defining Simple Generics (in the Bonus trail)

Generics and Subtyping (in the Bonus trail)

Wildcards (in the Bonus trail)

Generic Methods (in the Bonus trail)

Interoperating with Legacy Code (in the Bonus trail)

The Fine Print (in the Bonus trail)

Class Literals as Runtime-Type Tokens (in the Bonus trail)

More Fun with Wildcards (in the Bonus trail)

Converting Legacy Code to Use Generics (in the Bonus trail)

Acknowledgements (in the Bonus trail)


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

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