Since T
has an upper bound of D
, A<?>
is just a shorthand for A<? extends D>
. They both mean the same thing - just like if T
were unbounded, A<?>
would be short for A<? extends Object>
.
I don't know of any best practice when it comes to this syntax; I think it's just a matter of coding style. I would prefer A<?>
because it's concise, though A<? extends D>
immediately communicates the upper bound to a developer unfamiliar with A
.