title: In a java enhanced for loop, is it safe to assume the expression to be looped over will be evaluated only once?
body: <p>In Java, a for-each loop.<br>
  If I have a method that generates an array, called <code>genArray()</code>.</p>
  
  <p>In the following code, will the array each time be re-generated by calling <code>genArray()</code>?
  Or will Java call once the method and store a copy from the array?</p>
  
  <pre><code>for (String s : genArray())
  {
      //...
  }
  </code></pre>
  
  <p>Thanks</p>