title: Java error: The method XXX in the type XXX is not applicable for the arguments
body: <p>There is an error in the method <strong>add</strong> in the following java text:</p>
  
  <pre><code>import java.util.Vector;
  
  public class test {
      Vector&lt;? extends CellObject&gt; v = new Vector&lt;&gt;();
  
      class Cell extends CellObject {
          // some definitions here
          public Cell() {
              v.add(this);
          }
      }
  }
  </code></pre>
  
  <p>Why I can't use bounded wildcard? My problem that at the moment (and in the place) of creating the vector <strong>v</strong> I really don't know future subclass that will be stored in the vector. </p>
  
  <p>I know that in the case</p>
  
  <pre><code>    Vector&lt;CellObject&gt; v = new Vector&lt;&gt;();
  </code></pre>
  
  <p>there will be no error, but components of the vector are not of the class CellObject.</p>