This week we learned about generic programming, which allows us to write code that is reused by many different types of objects. A generic class is a class that has one or more type variables. We can define generic classes, or we can define generic methods, which can be defined in ordinary classes and generic methods. The invocation of a generic method is to put a specific type in the angle brackets before the method name.
Type variables are qualified, <t extends A>t can bind classes or interfaces, a type variable or wildcard can have more than one qualification, with & connection.
Wildcard characters are not type variables, and when a wildcard is caught, the compiler must be able to be sure that the wildcard expression is a single, deterministic type. Unqualified wildcard characters, such as pair<? > But it's different from the original pair.
201671010109 2016-2017-2 "Java Program Design" Tenth Week learning experience