ensure type safety and to detect runtime errors during compilation. Unlike C#, information on the used parameters is not available at runtime due to type erasure. Generic classes Classes can be parameterized by adding a type variable inside angle brackets (< and >) following the class name. It makes possible the use of this type variable in class members instead of actual types. There can be more than one type variable, in which case they are declared in a comma-separated list. It is possible to limit a type variable to a subtype of some specific class or declare an interface that must be implemented by the type. In this case the type variable is appended by the extends keyword followed by a name of the class or the interface. If the variable is constrained by both class and interface or if there are several interfaces, the class name is written first, followed by interface names with & sign used as the delimiter. /* This class has two type variables, T and V. T must be a subtype of ArrayList and implement Formattable interface */ public class Mapper<T extends ArrayList & Formattable, V> { public void add(T array, V item) { // array has add method because it is an ArrayList subclass array.add(item); } } When a variable of a parameterized type is declared or an instance is created, its type is written exactly in the same format as in the class header, except the actual type is written in the place of the type variable declaration. /* Mapper is created with CustomList as T and Integer as V. CustomList must be a subclass of ArrayList and implement Formattable */ Mapper<CustomList, Integer> mapper = new Mapper<CustomList, Integer>(); Since Java SE 7, it is possible to use a diamond (<>) in place of type arguments, in which case the latter will be inferred. The following code in Java SE 7 is equivalent to the code in the previous example: Mapper<CustomList, Integer> mapper = new Mapper<>(); When declaring a variable for a parameterized type, it is possible to use wildcards instead of explicit type names. Wildcards are expressed by writing ? sign instead of the actual type. It is possible to limit possible types to the subclasses or superclasses of some specific class by writing the extends keyword or the super keyword correspondingly followed by the class name. /* Any Mapper instance with