title: Passing a variable from a private method
body: <p>I have a private method "questionSubmitActionPerformed", that creates a variable "input". I would like to use this variable in another method, called "compareAnswers". Since my IDE of choice (Netbeans) won't let me change the private into public, is there any way to pass the variable down to the method? Here's a excerpt of my code:</p>
  
  <pre><code> private void questionSubmitActionPerformed(java.awt.event.ActionEvent evt) {                                               
      //gets input and clears answer area
      input = questionAnswer.getText();
      //calls the comparison, returns Yes or No 
      compareAnswers();
   }
  
   private void compareAnswers() {
      //compare input to the ArrayList
  }
  </code></pre>
  
  <p>Note that just changing the "private" to "public" in the first method is not an option for me    </p>