title: Java generics super keyword
body: <p>I went through these topics</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/591004/generics-super-t/591011">Generics..? Super T</a></li>
  <li><a href="https://stackoverflow.com/questions/2800369/bounding-generics-with-super-keyword">Bounding generics with 'super' keyword</a></li>
  </ul>
  <p>However, I still seem to be kind of lost with <code>super</code> keyword:</p>
  <ol>
  <li><p>When we declare a collection like that:</p>
  <pre><code>List&lt;? super Number&gt; list = null;
  list.add(new Integer(0)); // this compiles
  list.add(new Object()); // this doesn't compile
  </code></pre>
  </li>
  </ol>
  <p>shouldn't it be the opposite - we have a list that contains some objects (of unknown type) which are parents of <code>Number</code>. So <code>Object</code> should fit (since it is the parent of <code>Number</code>), and <code>Integer</code> shouldn't. The opposite is the case for some reason.</p>
  <ol start="2">
  <li><p>Provided we have the following code</p>
  <pre><code>static void test(List&lt;? super Number&gt; param) {
    param.add(new Integer(2));
  }
  
  public static void main(String[] args) {
    List&lt;String&gt; sList = new ArrayList&lt;String&gt;();
    test(sList);            // will never compile, however...
  }
  </code></pre>
  </li>
  </ol>
  <p>It is impossible to compile the above code (and my sanity suggests that this is the right behaviour), but the basic logic could prove the opposite:</p>
  <p><code>String is Object, Object is superclass of Number. So String should work.</code></p>
  <p>I know this is crazy but isn't this the reason why they didn't allow <code>&lt;S super T&gt;</code> constructs? If yes, then why <code>&lt;? super T&gt;</code> is allowed?</p>
  <p>Could someone help me restore the missing part of this logic chain?</p>