What is the meaning of the > token in this code copied from www.JavaPractices.com? When I replace it with the more conventional looking
That is Generic Type... usually we set String, Object, or any other objects as generic types... but here they make it general. and generic type stands for the value it can store or hold. its generally used in Collections..
well there is no much diff between the both.. - takes all kind of objects
-is also called `formal type parameter` makes use of what ever type of object you pass in .. for instance you can do this with and not with >
public class Box {
private T t; // T stands for "Type"
public void add(T t) {
this.t = t;
}
public T get() {
return t;
}
}
for more see http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf and http://download.oracle.com/javase/tutorial/java/generics/gentypes.html