Wildcard (Java): Difference between revisions

Content deleted Content added
m ISBNs (Build KC)
No edit summary
Line 86:
 
In order to be able to do both add objects of type <code>MyClass</code> to the list and iterate over it using a variable of type <code>MyClass</code>, a <code>List<MyClass></code> is needed, which is the only type of <code>List</code> that is both <code>List<? extends MyClass></code> and <code>List<? super MyClass></code>.
 
 
==See also==
 
* [[Covariance and contravariance (computer science)]]
 
== References ==