title: Why does the assignment of a short variable to an Integer reference produce a compile time error?
body: <p>I have the following code in Java :</p>
  
  <pre><code>class Boxing
      {
          public static void main(String args[])
          {
              short s = 10;
              Integer iRef = s;
          }
      }
  </code></pre>
  
  <p>Why does it produce an error in compilation? If I explicitly typecast the short to an integer in the expression, it compiles successfully. Since I'm using a short in an expression isn't the type of that supposed to be an integer by default without requiring the explicit case?</p>