title: Explain to me what these constructors are doing in this program?
body: <p>I just learned about constructors and had to use them in a recent program. I got it right however I still do not understand exactly what they do. If someone could give me a detailed explanation using this program as reference that would be great!</p>
  
  <p><strong>MAIN CLASS</strong></p>
  
  <pre><code>public class Student 
  {
  
  public static void main(String[]args)
  {
  
      String question, name, GPAStr, studentNumberStr;
      int studentNumber;
      double GPA;
  
      question = JOptionPane.showInputDialog("Would you like to see if you Qualify for the Dean's List? (Y or N)");
  
      while (question.equalsIgnoreCase("Y"))
      {
          name = JOptionPane.showInputDialog("Please enter your name.");
  
          studentNumberStr = JOptionPane.showInputDialog("Please enter your student number.");
          studentNumber = Integer.parseInt(studentNumberStr);
  
          GPAStr = JOptionPane.showInputDialog("Please enter your GPA.");
          GPA = Double.parseDouble(GPAStr);
  
          StudentIO students = new StudentIO(name, GPA);
  
          // ouput
  
          JOptionPane.showMessageDialog(null, students.getDeansList());
  
          question = JOptionPane.showInputDialog("Would you like to see if you Qualify for the Dean's List? (Y or N)");
  
          if (question.equalsIgnoreCase("N"))
              //display the content of players processed
  
          {
              JOptionPane.showMessageDialog(null,StudentIO.getCount());
          }
      }
  }
  }
  </code></pre>
  
  <p><strong>SECOND CLASS(THE ONE WITH CONSTRUCTORS THEY ARE LABELED)</strong></p>
  
  <pre><code>public class StudentIO 
  {
  
  //instance fields
  
      private String name;
      private double GPA;
  
      // static fields
  
      private static final double GPAMIN=3.0;
      private static int count = 0;
  
      public StudentIO(String theName, double theGPA)  // constructor
      {
          name = theName;
          GPA= theGPA;
  
          count = count +1;
      }
  
      public StudentIO()    //no arg constructor
      {
          name = " ";
          GPA = 0;
  
          count = count +1;
      }
  
      public void setName(String theName)
      {
          name = theName;
      }
  
      public void setGPA(double theGPA)
      {
          GPA = theGPA;
      }
  
  
      public String getName()
      {
          return name;
      }
  
      public double getGPA()
      {
          return GPA;
      }
  
      public String getDeansList()
      {
          if(GPA &gt;= GPAMIN)
              return (name + ", has made the Dean's List!");
          else
              return(name + ", did not make the Dean's List!");
  
      }
  
      public static String getCount()
      {
          return ("You processed " + count + "students.");
      }
  }
  </code></pre>