title: List<? extends MyType>
body: <p>I have a Java question about generics. I declared a generic list: </p>
  
  <pre><code>List&lt;? extends MyType&gt; listOfMyType;
  </code></pre>
  
  <p>Then in some method I try instantiate and add items to that list:</p>
  
  <pre><code>listOfMyType = new ArrayList&lt;MyType&gt;();
  listOfMyType.add(myTypeInstance); 
  </code></pre>
  
  <p>Where <code>myTypeInstance</code> is just an object of type <code>MyType</code>; it won't compile. It says:</p>
  
  <blockquote>
    <p>The method add(capture#3-of ? extends
    MyType) in the type List&lt;capture#3-of
    ? extends MyType> is not applicable
    for the arguments (MyType)</p>
  </blockquote>
  
  <p>Any idea?</p>