title: while loop inside for loop, confused?
body: <p>Completely new to programming, and I was doing a project and I am confused on how I can make it work. Please help me</p>
  
  <pre><code>        boolean answer1 = true; 
          for (int i=0;i&lt;q.questionbank.length;++i)
         {   q.Question = input(q.questionbank[i]);
  
          while(answer1 == true)
         {
  
          if (q.Question.equals(a.correctans) || (q.Question.equals(a.impossibleans) || (q.Question.equals(a.wrongans))))
          {
              score = printquiz(answer,score,q.Question);
              answer1 = false;
          }
          else
          {
              print("Not a Valid Answer, please try again\n");
          }
      }
      }
      return score;
  </code></pre>
  
  <p>Over here, I have a class called questionbank and quiz. The correctans/impossibleans/wrongans are part of the quiz data type. whereas the q.question is part of questionbank. I have some question on an array in the questionbank data type. I want to use for loop to go through the questions and if the user input the correct answer, there score goes up. It works for the first question but doesnt for the second question. usually when they answer correctly, I have another method printquiz that has decision statements to tell the user if their answer is correct or wrong, and assign them points. but its not even going to that method after the first iteration of the loop. I am confused on what is going on. Please help me</p>