title: Accessing an integer outside its for loop
body: <pre><code>for (int x = 1; x &lt;= 3; x++) {
    System.out.println("Number: " + x);
  }
  System.out.println("Done! Counted to: " + x);
  </code></pre>
  
  <p>This gives an error, suggesting to me that I can't access the variable outside the <code>for</code> loop.<br>
  Is there a way to do so? </p>