jeudi, avril 12, 2007

Generic Types

Parameter Naming Conventions
  • E - Element (used extensively by the Java Collections Framework)
  • K - Key
  • N - Number
  • T - Type
  • V - Value
  • S,U,V etc. - 2nd, 3rd, 4th types


Generic Methods and Constructors
public static <U> void fillBoxes(U u, List<box<U>> boxes)


Bounded Type Parameters
<U extends Number & MyInterface>

0 commentaires: