title: Java arithmetic int vs. long
body: <p>I've done some searching on google, but I can't seem to find what I'm looking for. I'm trying to find out some detailed information on the way arithmetic works in Java. For example, if you add two longs together is this using the same addition operator that is used when adding two ints together? Also, what is going on under the hood when you mix longs and ints in arithmetic expressions like this:</p>
  
  <pre><code>long result;
  long operand a = 1;
  int operand b = 999999999;
  
  result = a + b;
  </code></pre>
  
  <p>If anyone could shed some light on this or post links to relevant articles that would be awesome. Thanks!</p>
  
  <p>EDIT: Thanks for the replies so far. Also, is it safe to perform arithmetic with different primitives so long as you are assigning into a variable of the widest primitive type in your expression?</p>