Wildcard (Java): Difference between revisions

Content deleted Content added
Hamsooper (talk | contribs)
Fixed several instances where type arguments were mistakenly called type parameters. Removed a phrase where the parameterized type "Generic<?>" was called abstract, which it is not (in the sense defined by the JLS). Gave the "Bounded Wildcards" section subsections for upper and lower bounds.
Tags: references removed Visual edit
Hamsooper (talk | contribs)
m Bounded wildcards: Added the clarification that wildcards cannot explicitly state both an upper and lower bound.
Line 32:
== Bounded wildcards ==
 
A bounded wildcard is one with either an upper or a lower [[Inheritance (object-oriented programming)|inheritance]] constraint. The bound of a wildcard can be either a class type, interface type, array type, or type variable. Upper bounds are expressed using the '''extends''' keyword and lower bounds using the '''super''' keyword. Wildcards can state either an upper bound ''or'' a lower bound, but not both.
 
=== Upper bounds ===