Java: generics type
<p>Class B extends from class A, and G is generics class. Now -</p>

<pre><code>G&lt;X&gt; g = new G&lt;B&gt;();
</code></pre>

<p>If I'm not wrong, then X can be:</p>

<pre><code>? extends A
</code></pre>

<p>or</p>

<pre><code>? super B
</code></pre>

<p>My question: Why X can't be simply <code>A</code>. B extends from A, so that seems correct. Where am I wrong?</p>
