Description: The addition of generic types and methods to the Java programming language has been explored since the first release of Java. Eventually, with the 1.5 release of J2SE, support for Java generics will be incorporated in the language.
A common misconception regarding generics is its comparison to C++ templates. Many people believe that Java generics are similar to C++ templates, while in fact both features have barely anything in common: C++ templates is a Turing complete language - Java generics is syntactic sugar that elides some casting. Java generics are a pure compile-time feature that is translated to non-generic Java bytecode, for reasons of compatibility with previous versions of Java.
In this tutorial, we will take a look into the proposed language feature, how it will help us improve our programs, how it is supposed to be used and where its limitations are.
More specifically, we will discuss the additions made to the language itself (parameterized types and methods as well as covariant return types), changes to the platform libraries (generic collections and extended reflection) and various exciting details of generics such as the properties of type parameters (their bounds and their scope), generic methods and type parameters inference, and the translation of generics into bytecode.
This is an intermediate session, aimed at Java developers who want to deep their command of the language up-to-date. It requires a basic knowledge of Java.