1 Template definition
In the diagram above, we find the class template, operation template and operation parameter template. In the class template, “ E ” is a template variable type, which is used in the method add(E) .
We can also find an operation template using a local template variable:
<T> T[] toArray(T[] a);
where the variable “ T ” is an operation template variable. It is used in the scope of this method.
2 Template binding
Besides the template definition, it is necessary to show the template utilization relationship, called template binding. In the above diagram, this relationship is shown as an arrow “ E -> ? ”. The first example is the following method:
boolean retainAll(Collection<?> c);
The class template variable “ E ” of the collection binds to an unspecified type in the argument for this method.
http://www.soyatec.com/euml2/com.soyatec.uml.doc/jdk15/generic-type/index.html