title: Java generics - Class<? extends Base>
body: <p>I'm confused a bit about Java generics.
  I have a class Test which extends from Base:</p>
  
  <pre><code>public class Test extends Base {
      private final static Test obj = new Test();
  
      new Auto(obj);
  }
  </code></pre>
  
  <p>The constructor of Auto is like this (not my class):</p>
  
  <pre><code>public Auto (Class&lt;? extends Base&gt; programclass) {}
  </code></pre>
  
  <p>And I'm getting this error:</p>
  
  <pre><code>Test cannot be converted to Class&lt;? extends Base&gt;
  </code></pre>
  
  <p>How should I declare <code>obj</code> variable so I can pass it to <code>Auto</code> constructor?</p>
  
  <p>Thanks</p>