Content deleted Content added
m →Bounded Wildcards: corrected non-standard use of prepositions, and lack of conjunction between phrases |
m →Object Creation with Wildcard: corrected punctuation; added indefinite articles required by standard English |
||
Line 43:
== Object Creation with Wildcard ==
No objects may be created with a wildcard type parameter: <code>
On the other hand, an array object that is an array of a parameterized type may be created only by an unconstrained (i.e. with a wildcard type parameter) type (and by no other instantiations) as the component type: <code>'''new''' Generic<?>[20]</code> is correct, while <code>'''new''' Generic<UpperBound>[20]</code> is prohibited.
An example of using a wildcard in List's instantiation is contained in the article [[Generics in Java]].
== Example: Lists ==
|