title: While loop not working
body: <p>Hi I am fairly new to java and trying to familiarize myself to it by doing some exercises online.
  How do i properly code the while loop so that everytime the user input is wrong it asks the same question again and does not proceed to the next line of code</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  import java.util.Scanner;
  
  public class Array {
      public static void main(String[] args) {
          Scanner dataIn = new Scanner(System.in);
          int entries = 0;
          List&lt;Integer&gt; grade = new ArrayList&lt;Integer&gt;();
  
          System.out.println("Enter number of students? ");
          entries = dataIn.nextInt();
          boolean checker = true;
          while (checker){
          for (int i = 0; i &lt; entries; i++){
  
              int input;
              int addToList;
              System.out.println("Enter grade for student: ");
              input = dataIn.nextInt();
              grade.add(input);
  
              if (input &gt;= 0 &amp;&amp; input&lt;= 100) {
  
              }else {
                  System.out.println("invalid input try again..");
                  checker = false;
              }
          }
          }
  
          int sum = 0;
          int count = grade.size();
          double mean;
          for (int grades : grade){
              sum+= grades;
          }
          mean =(double)sum/count;
  
          System.out.println("The Grades are: " + grade);
          System.out.println("The number of elements in the Array is " + grade.size());
          System.out.println("The average is: " + mean);
      }
  }
  </code></pre>