previous | start | next

Syntax 22.1: Instantiating a Generic Class

modifiers <TypeVariable1, TypeVariable2, . . .> returnType methodName(parameters)
{
body
}

Example:

 
public static <E> void print(E[] a)
{
. . .
}

Purpose:

To define a generic method that depends on type variables


previous | start | next