Is declaring a local variable and setting it once more efficient than using a getter over and over?
<p>I was going through some code today and saw this:</p>

<pre><code>    x.add(getResources().getString(R.string.none));
    x.add(getResources().getString(R.string.today));
    x.add(getResources().getString(R.string.tomorrow));
    ...
</code></pre>

<p>and so I thought, "that's inefficient!" and started to change it to:</p>

<pre><code>    Resources res = getResources();
    x.add(res.getString(R.string.none));
    x.add(res.getString(R.string.today));
    x.add(res.getString(R.string.tomorrow));
    ...
</code></pre>

<p>but then I stopped and wondered: Is the second section of code really more efficient or does it not really matter?  Is the compiler going to generate the same byte code either way? </p>
