Java: How many times is arr.length called in a for-loop?
<p>If <code>arr</code> is an array of size 10, in the following code block, how many times is <code>arr.length</code> accessed?</p>

<pre><code>for (int i = 0; i &lt; arr.length; ++i);
</code></pre>

<p>Once? Or every time it loops?</p>

<p>Thanks everyone! Here's what I ended up doing:</p>

<pre><code>final int len = arr.length;
for (int i = 0; i &lt; len; ++i);
</code></pre>
