Unlike arrays (which are covariant in Java[2]), different instantiations of a generic type are not compatible with each other, not even explicitly.
[5] In the body of a generic unit, the (formal) type parameter is handled like its upper bound (expressed with extends; Object if not constrained).
can be referenced by a variable of the type of the upper bound (or Object).
Sample code for the Generic
[5] An example of a wildcard that explicitly states an upper bound is: Generic
A wildcard that does not explicitly state an upper bound is effectively the same as one that has the constraint extends Object, since all reference types in Java are subtypes of Object.
super SubtypeOfUpperBound> referenceConstrainedFromBelow; can hold any parameterization of Generic whose any type argument is both a subtype of the corresponding type parameter's upper bound and a supertype of SubtypeOfUpperBound.
[5] No objects may be created with a wildcard type argument: for example, new Generic>() is forbidden.
[7] The mnemonics PECS (Producer Extends, Consumer Super) from the book Effective Java by Joshua Bloch gives an easy way to remember when to use wildcards (corresponding to Covariance and Contravariance) in Java.