Why can't you assign an int to an Integer in a loop without curly braces?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1974641/why-this-is-not-compiling-in-java">Why this is not compiling in Java?</a>  </p>
</blockquote>

<p>In java, curly braces are optional for one line for loops, but I've found a case where it isn't allowed. For instance, this code:</p>

<pre><code>for(int i = 0; i &lt; 10; i++)
    Integer a = i;
</code></pre>

<p>won't compile, but if you add curly braces, like so:</p>

<pre><code>for(int i = 0; i &lt; 10; i++){
    Integer a = i;
}
</code></pre>

<p>it will. Why won't this code compile?</p>
