Skip to main content


developerWorks  >  Java technology  >

Introduction to generic types in JDK 5.0

developerWorks

Level: Intermediate

Brian Goetz (brian@quiotix.com), Principal Consultant, Quitox

07 Dec 2004

Register now or sign in using your IBM ID and password.

This tutorial introduces generic types, a new feature in JDK 5.0 that lets you define classes with abstract type parameters that you specify at instantiation time. Generics increase the type safety and maintainability of large programs. Follow along with frequent developerWorks contributor and Java™ programming expert Brian Goetz, as he explains the motivation for adding generics to the Java language, details the syntax and semantics of generic types, and provides an introduction to using generics in your classes.

Prerequisites

This tutorial is intended for intermediate and advanced Java developers who want to learn how the new language support for generics works. It is assumed that readers are familiar with developing interfaces and classes in the Java language, and with basic object-oriented design techniques.
The generics language feature is available only in JDK 5.0 and later. If you are developing software based on earlier JDK versions, you cannot use the generics features in your code until you migrate to JDK 5.0 or later.


System requirements

You must have a JDK 5.0 development environment available to you in order to use generics. You can download JDK 5.0 from the Sun Microsystems Web site.



Duration

Under two hours


Formats

html, pdf


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!


Back to top


Document options

Document options requiring JavaScript are not displayed


My developerWorks needs you!

Connect to your technical community