I think one of the main questions and confusion that can occur is really understanding the difference between
<T extends XXX>
and
<? extends XXX>
In some ways they are the same thing, but they are used in different contexts.
When you are creating something Generified, like a template class or template interface, you generally have no idea what the actual implementation class will want to use, and you define a letter, to be overwritten later in an actual implementation class. That letter being "T" which generally stands for Type.
Now, lets say you have a class that has a method that you are not sure who will be calling it, what type it will be passing it, and you are not generifying the method or class, but just want to allow someone to call it. That is when you use the "?" style.
So let's look at the Collection Classes. Instead of using T, they use E. What they are doing is generifying the Collection Class, it is not an actual instantiated object. When you instantiate a List, you define what "E" stands for as in List<MyObject> is a List of MyObjects.
so here is an example. I am going to generify a method in an interface
in that case I cannot use a "?". It isn't allowed.
now I am actually implementing the interface, and I have
Now I can use the ?, and I cannot use T or S because I am not generifying the method I implementing a method, in which I don't know which type of List they will send to me. It can be a List of Longs or a List of Numbers. The only thing I now can't do is add to the List that is being passed to my real getSomething method. Another Topic.
Mark