title: Storing Data in a Variable vs Inline Arithmetic
body: <p>Is there any difference between these two code snippets in terms of memory usage and performance/overhead?</p>
  
  <pre><code>final float xPos = (CAMERA_WIDTH / 2) - (mSprite.getWidth() / 2);
  final float yPos = (CAMERA_HEIGHT / 2) - (mSprite.getHeight() / 2);
  mSprite.setPosition(xPos, yPos);
  </code></pre>
  
  <p>and the other case:</p>
  
  <pre><code>mSprite.setPosition(((CAMERA_WIDTH / 2) - (mSprite.getWidth() / 2)), ((CAMERA_HEIGHT / 2) - (mSprite.getHeight() / 2)));
  </code></pre>
  
  <p>The only difference I can see is that the first snippet is storing the variable in what I assume to be a different area of memory than the second snippet, but I'm not very familiar with Java memory allocation (I'm more of a C/C++ person). </p>
  
  <p>My question is: is there any benefit to one way or the other? Does using the <code>final</code> keyword in the first example affect it at all?</p>
  
  <p>Thank you!</p>