The <> operator is used to specify classes in generic templates.
Image a generic "list". In Java up to 1.4, a "list" could only contain generic Object
s.
If you wanted to make sure you only kept String
s in your list you had to use a lot of casting and helper methods, which made the code barely readable.
Java 5 introduced generics, which solves the problem - you can create a template class "list of ", and parametrise the class used as parameter or return value.
Furthermore, you can use the <L extends ...>
and <L super ...>
to limit the range of classes your template works with, have multiple classes as parameters <class1,class2>
and combine things up <class1,class2<class3>>
at will.
There is a very good tutorial at http://www.javacodegeeks.com/2011/04/java-generics-quick-tutorial.html