title: Which type safety would have lost, had Generics supported the sub-typing?
body: <p>Consider the snippet:</p>
  
  <pre><code>Number[] numbers = {1, 2.3, 4.5f, 6000000000000000000L};
  </code></pre>
  
  <p>It's perfectly okay to do the above, <code>Number</code> is an abstract class.</p>
  
  <p>Going ahead,</p>
  
  <pre><code>List&lt;Long&gt; listLong = new ArrayList&lt;Long&gt;();
  listLong.add(Long.valueOf(10));
  
  List&lt;Number&gt; listNumbers = listLong; // compiler error    - LINE 3
  
  listNumbers.add(Double.valueOf(1.23));
  </code></pre>
  
  <p>Had Line 3 was designed to be compiled successfully,
  we would end up with a <code>List</code> of <code>Number</code>s, i.e,</p>
  
  <pre><code>for(Number num: listNumbers ){
      System.out.println(num);
  }
  
  // 10
  // 1.23
  </code></pre>
  
  <p>which are all numbers.</p>
  
  <p>I came across this in a book,</p>
  
  <blockquote>
    <p>Generics doesn’t support sub-typing because it will cause issues in
    achieving type safety. That’s why <code>List&lt;T&gt;</code> is not considered as a
    subtype of <code>List&lt;S&gt;</code> where <code>S</code> is the super-type of <code>T</code></p>
  </blockquote>
  
  <p>Which type safety would have lost in this <strong><em>specific</em></strong> case as discussed above, were the Line 3 was to be compile successfully?</p>