By my reading of the specification, super
can only be used with a wildcard and can't be captured into a type variable; see JLS 4.5.1. Similarly, &
is only valid in type variables, not type arguments, and type variables can't use super
.
After having thought about it, here's my explanation: The reason for a type variable is to eliminate explicit casting to improve type safety. When you declare a type parameter to be super Foo
, you're saying that it's okay for that parameter to be any superclass of Foo
. This means that it could be anything up to and including Object
, and so you have no safe way to presume anything about the objects whose type satisfies that bound, and so there's no information whatsoever contained within a named type variable; you just wildcard it and can call hashCode()
or toString()
, but nothing type-specific.