I'm guessing you're talking about the use of extends in type parameter declarations. In that case:
class My_Abstract<T extends SomeAbstract>
has a bounded type parameter called T
that must be SomeAbstract
or some subtype of it.
class My_Abstract<SomeAbstract>
has an unbounded type parameter called SomeAbstract
that could be anything. Note that SomeAbstract
no longer refers to the actual type SomeAbstract
that the first example uses at all!
To expand on that: imagine if the second declaration were class My_Abstract<T>
. The T
there is clearly a type parameter, not an actual type. But it doesn't have to be called T
... it can be called E
or Bob
or SomeAbstract
. In all of these cases, it is still just a type parameter... an actual type can never go there, nor does it make any sense for it to (the whole point of a type parameter is to NOT refer to a specific type but instead allow other types to be put in its place when instances of the class are created).
In the code you've edited in, change My_Child
's declaration to
class My_Child extends My_Abstract<Object>
and you'll see the difference. If you actually try to do something using the type parameter SomeAbstract
in the second version, you'd also find that you cannot call any methods declared in the real SomeAbstract
class. This is all a good example of why you should always follow the convention of using single-letter type parameters... it's really confusing if you don't.
This is getting really long, but I also want to note that all of this is basically unrelated to the first half of your question. Wildcards like ? extends SomeAbstract
and ? super SomeAbstract
aren't used in type parameter declarations (such as those used when defining a generic class), they're primarily used for method parameters. List
is a typical example for explaining why wildcards are needed because its nature as a container of objects makes it relatively easy to understand, but rules pertaining to them apply to any generic type. I tried to explain this in relatively general terms in this answer.
SomeAbstract
is a formal type parameter. It doesn't refer to the class by the same name. Are you sure this is what you meant? – Pylorectomy