Content deleted Content added
→Bounded Wildcards: elaborate/improve exposition |
|||
Line 32:
== Bounded Wildcards ==
A bounded wildcard is one with either an upper or a lower [[Inheritance (object-oriented programming)|inheritance]] constraint. The
<code>Generic<? '''extends''' SubtypeOfUpperBound> referenceConstrainedFromAbove;</code>
This reference can hold any instantiation of <code>Generic</code> with an actual type parameter of <code>SubtypeOfUpperBound</code>'s subtype. A wildcard that does not have
<code>Generic<? '''super''' SubtypeOfUpperBound> referenceConstrainedFromBelow;</code>
|