title: Type promotion in Java
body: <p>I have a problem with the below Java statements:</p>
  
  <pre><code>byte b = 10;
  byte r = (byte) (b * b); // Giving correct result
  byte r = (byte) b * b; // Giving error " POSSIBLE LOSS OF PRECISION"
  </code></pre>
  
  <p>Why is it mandatory to give parentheses to <code>b * b</code>?</p>