title: "cannot find symbol" error in netbeans ( Java Netbeans 6.5 )
body: <p>For my final project in introduction to Java, I decided to do a Mastermind Peg Game.</p>
  
  <p>This is the submit button code:</p>
  
  <pre><code>private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) {
  
      Integer guess1, guess2, guess3, guess4;
      Integer rightnumber = 0, rightposition = 0;
  
      guess1 = Integer.parseInt (firstInput.getText());
      guess2 = Integer.parseInt (secondInput.getText());
      guess3 = Integer.parseInt (thirdInput.getText());
      guess4 = Integer.parseInt (fourthInput.getText());
  
      //Values are compared to the actual guess. 
      //(THIS IS WHERE I GET THE FOLLOWING ERROR: 
      //"cannot find symbol, symbol : variable answerdigit, 
      //location: class finalproject.Singleplayer"
  
      if ( guess1 == answerdigit[0]);
      {
          rightposition = rightposition + 1;
      }
  }
  </code></pre>
  
  <p>This is the Start button. Here, the 4 digit answer/code is produced.</p>
  
  <pre><code>private void startButtonActionPerformed(java.awt.event.ActionEvent evt)
  {                                            
      // Declare variables for 4 digit answer, guess for each number
      Integer one, two, three, four;
  
      //Generate random number between 1 and 6 for each digit in the answer
      int[] answerdigit = new int[4];
  
      for(int i=0;i&lt;4;i++)
      {
          answerdigit[i]=(int)(Math.random()*6+1);
      }
  }              
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code>cannot find symbol, symbol : variable answerdigit, location: class finalproject.Singleplayer
  </code></pre>
  
  <p>I don't understand what the error means.</p>