title: Autoboxing/widening occurs in Short a=3 but not in Float a=3;
body: <p>I understand that the following code won't work</p>
  
  <pre><code>Float a=3
  </code></pre>
  
  <p>because its translated as Float a=Integer.valueOf(3). We'll have a Float reference on the LHS and an Integer object on the RHS, which is incompatible. But :</p>
  
  <p>1.</p>
  
  <pre><code>     `Short a=3;`
  </code></pre>
  
  <p>This works, though here again, we'll have a Short reference on the LHS and an Integer object on the RHS.</p>
  
  <p>2.</p>
  
  <p><code>Float a=(Float) 3</code></p>
  
  <p>If we hadn't typecasted 3, it would have been translated as Integer.valueOf(3). Now, will it be translated as Float.valueOf(3) ?</p>