title: How does "final int i" work inside of a Java for loop?
body: <p>I was surprised to see that the following Java code snippet compiled and ran:</p>
  
  <pre><code>for(final int i : listOfNumbers) {
       System.out.println(i);
  }
  </code></pre>
  
  <p>where listOfNumbers is an array of integers.</p>
  
  <p>I thought final declarations got assigned only once. Is the compiler creating an Integer object and changing what it references?</p>