title: can't understand error for new Java learner
body: <p>I just started learning java a week ago and I'm trying to make an array with a maximum of 10 individuals.</p>
  <p>I need to then have the first name, last name, and date of birth of a student and have it in a loop or something until they type the correct date, for example u can't enter a month of 13 because it is invalid.</p>
  <p>There is a part where I have to confirm with the user if the information is correct, where they reply yes or no, I keep getting an error in this part and would like to know what it means.</p>
  <p>Sorry if my English is bad it's not my first language. <a href="https://i.stack.imgur.com/hj2Zy.png" rel="nofollow noreferrer">enter image description here</a></p>
  <pre><code>package com.company;
  
  import java.util.Scanner;
  
  import static com.company.ProjectCONSTANTS.*;
  
  public class Main {
  
      public static void main(String[] args) {
  
          Student icsClass[] = new Student[10];
  
          Scanner s = new Scanner(System.in);
  
          Student st = new Student();
          Boolean InputOK = true;
          String sInput;
          String tmpFirstName, tmpLastName;
          int a1, a2, a3;
  
          int iInput;
          int counter = 0;
  
          while (counter &lt; 2) {
  
              // While loop for First Name
              do {
                  System.out.println(&quot;Please enter the first name of the student&quot;);
                  sInput = s.nextLine();
                  tmpFirstName=sInput;
                  if (sInput.isEmpty()) {
                      System.out.println(&quot; String is left empty. Please enter your first name&quot;);
                      InputOK = false;
                  } else {
                      InputOK = true;
                      st.setFName(sInput);
                      //icsClass[counter].setFName(sInput);
                  }
              } while (!InputOK);
  
              // While loop for Last name
              do {
                  System.out.println(&quot; Pleas enter your last name&quot;);
                  sInput = s.nextLine();
                  if (sInput.isEmpty()) {
                      System.out.println(&quot; String is left empty. Please enter your last name&quot;);
                      InputOK = false;
                  } else {
                      InputOK = true;
                      st.setlName(sInput);
                      //icsClass[counter].setlName(sInput);
                  }
              } while (!InputOK);
  
              //  }
  // Ask user to input year
              do {
                  System.out.println(&quot; Pleas enter your year of birth&quot;);
                  sInput = s.nextLine();
                  iInput = Integer.parseInt(sInput);
                  if (iInput &lt; MIN_YEAR || iInput &gt; MAX_YEAR) {
                      System.out.println(&quot;Not a valid year. Please input a valid Year between 1895 and 2021&quot;);
                      InputOK = false;
                  } else {
                      InputOK = true;
                      st.setYear(iInput);
                      //icsClass[counter].setYear(sInput);
                  }
              } while (!InputOK);
  
  // Ask user to input month
              do {
                  System.out.println(&quot; Pleas enter your month of birth&quot;);
                  sInput = s.nextLine();
                  iInput = Integer.parseInt(sInput);
                  if (iInput &lt; Min_Month || iInput &gt; MAX_MONTH) {
                      System.out.println(&quot;Not a valid month. Please input a valid month between 1 and 12&quot;);
                      InputOK = false;
                  } else {
                      InputOK = true;
                      st.setMonth(iInput);
                      //icsClass[counter].setMonth(sInput);
                  }
  
              } while (!InputOK);
  
              // ask user to input day
              do {
                  System.out.println(&quot; Pleas enter your day in your date of birth&quot;);
                  sInput = s.nextLine();
                  iInput = Integer.parseInt(sInput);
                  if (iInput &lt; MIN_DAY || iInput &gt; MAX_DAY) {
                      System.out.println(&quot;Not a valid day. Please input a valid day between 1 and 31&quot;);
                      InputOK = false;
                  } else {
                      InputOK = true;
                      st.setDay(iInput);
                      //icsClass[counter].setDay(sInput);
                  }
  
              } while (!InputOK);
  
          System.out.println(&quot;Student Data Saved:&quot; );
          System.out.println(&quot;Full Name :&quot; + st.getFName() + &quot; &quot; + st.getLName());
          System.out.println(&quot;Date of Birth :&quot; + st.getDay() + &quot;/&quot; + st.getMonth() + &quot;/&quot; + st.getYear());
  
          String vConfirm;
          System.out.println( &quot;Is the above information correct (yes/no) ?&quot;);
          vConfirm = s.next();
  
          if (vConfirm.equals(&quot;yes&quot;)) {
               // Save the data to the array
              System.out.println(&quot;Full Name :&quot; + st.getFName());
              System.out.println(&quot;array length :&quot; + icsClass.length);
              System.out.println(&quot;Full Name :&quot; + tmpFirstName);
              System.out.println(&quot;counter value is : &quot; + counter);
              //icsClass[counter].setFName(tmpFirstName);
              //icsClass[counter].setlName(st.getLName());
              icsClass[0].setYear(2010);
              //icsClass[counter].setMonth(st.getMonth());
              // icsClass[counter].setDay(st.getDay());
          }
          if (vConfirm.equals(&quot;no&quot;)) {
              // don't change the counter and ask to re-enter the values
              System.out.println (&quot; inside no condition&quot;);
          }
      }
  }
  }
  </code></pre>