title: Java Cannot find symbol in same for-loop
body: <p>In the following code, the variable <code>number</code> cannot be found in the line <code>number++</code> even though I initialized <code>number</code> in the same for-loop. Can anyone tell me why?</p>
  
  <pre><code>import java.lang.Math;
  import java.util.Random;
  
  public class test
  {
      public static void main( String [] args )
      {
          String cardNumber; 
          double cardRandom;
          int cardRandomNumber;
          String[] cardSelection = new String[10];
  
          for (int number = 0; number &lt;=  9; );
          {
              Random ran = new Random();
              cardRandom = ran.nextInt(52 - 1 + 1) + 1;
              cardRandomNumber = (int) Math.round( cardRandom );
  
              if ( cardRandomNumber &gt; 0 &amp;&amp; cardRandomNumber &lt;= 52 )
              { 
                  cardNumber =  "card" + cardRandomNumber;
                  System.out.println( cardNumber );
                  number++; // Says Error: Cannot find symbol
              }
          }   
      }
  }
  </code></pre>
  
  <p>This program basically just picks a random number from 1-52, adds "cards" to the beginning of it and prints it out. It should print out 10 numbers.</p>