title: How to return a Vector of inheriting classes?
body: <p>I'm looking for a solution to instantiate and return a Vector (or sth comparable) of classes.</p>
  
  <p>My attempt looks like this (Heritage extends SuperClass):</p>
  
  <pre><code>public Vector&lt;? extends SuperClass&gt; getAssignableClasses()
  {
  Vector&lt;? extends SuperClass&gt; out = new Vector&lt;SuperClass&gt;();
  out.add(Heritage.class); //does NOT work, IDE shows error message
  
  return out;
  }
  </code></pre>
  
  <p>The list's declaration seems to be erroneous.
  I suppose by this I can only add objects to a list, but how can I add classes using generics?</p>
  
  <p>Thanks in advance!</p>