title: Are arithmetic operations on literals calculated at compile time or run time?
body: <p>I have the following:</p>
  
  <pre><code>double timeInMinutes = (double) timeInMilliseconds / (1000 * 60);
  </code></pre>
  
  <p>Is the operation <code>(1000 * 60)</code> done at compile time or at run time? In other words, are there performance differences during run time between the code snippet above and:</p>
  
  <pre><code>double timeInMinutes = (double) timeInMilliseconds / 60000;
  </code></pre>
  
  <p>EDIT: my question is different from <a href="https://stackoverflow.com/questions/3898259/will-the-java-compiler-precalculate-sums-of-literals">Will the Java compiler precalculate sums of literals?</a>, as I'm mixing the use of variables and literals in the arithmetic operations. It's a small difference, but as @TagirValeev noted in the comments (<a href="https://stackoverflow.com/questions/33040680/are-arithmetic-operations-on-literals-calculated-at-compile-time-or-run-time#comment53902701_33040817">Are arithmetic operations on literals calculated at compile time or run time?</a>), there are instances where some literals aren't pre-compiled even though they could be.</p>