title: data type of results of java arithmetic calculation
body: <p>In java, I know the data type of the result of an arithmetic calculation depends on the data types of the numbers involved in the calculation. 
  For example, </p>
  
  <ol>
  <li><p>int + int = int</p></li>
  <li><p>long/double=double</p></li>
  </ol>
  
  <p>a. But I can't find any references which can give me all these rules. Could someone help me?</p>
  
  <p>b. How to avoid over flow in arithmetic calculation? For example, the results of 2 long may not fit into a long anymore...   </p>
  
  <p>Thanks a lot.</p>