title: Why are arrays covariant but generics are invariant?
body: <p>From Effective Java by Joshua Bloch,</p>
  
  <ol>
  <li>Arrays differ from generic type in two important ways. First arrays are covariant. Generics are invariant.</li>
  <li><p>Covariant simply means if X is subtype of Y then X[] will also be sub type of Y[]. Arrays are covariant As string is subtype of Object So</p>
  
  <p><code>String[] is subtype of Object[]</code></p>
  
  <p>Invariant simply means irrespective of X being subtype of Y or not ,</p>
  
  <pre><code> List&lt;X&gt; will not be subType of List&lt;Y&gt;.
  </code></pre></li>
  </ol>
  
  <p>My question is why the decision to make arrays covariant in Java? There are other SO posts such as <a href="https://stackoverflow.com/questions/6684493/why-are-arrays-invariant-but-lists-covariant">Why are Arrays invariant, but Lists covariant?</a>, but they seem to be focussed on Scala and I am not able to follow.</p>