Content deleted Content added
→Covariance for generic types: fixed link |
m →Covariance for generic types: fixed incorrect preposition; added required indefinite article |
||
Line 3:
== Covariance for generic types ==
Unlike arrays (which are [[Covariance and contravariance (computer science)#Covariant arrays in Java and C#|covariant]] in Java), different instantiations of a generic type are not compatible
This incompatibility may be softened by the wildcard if <code>?</code> is used as an actual type parameter: <code>Generic<?></code> is the abstract supertype for all instantiations of the generic type. It means, no objects of this type may be created, only variables. The usage of such a variable is to refer to instantiations of <code>Generic</code> with any actual type parameter.
== Wildcard as parameter type ==
|