/**
 *  While Loop Illustration<br>
 *
 *  @author Alyce Brady
 *  @version 11 February 2016
 */
public class Student
{
  // State: class variables (shared by all instances of the class)
    private static int nextAvailableID = 111111;

  // State: instance variables (each instance has their own copy
    private int id;
    private String name;
    private String major;

  // Constructors

    /**
     * Constructs a new object of this class.
     *      @param   initialValue    initial value for the object's state
     */
    public Student(String name, String major)
    {
        // initialise instance variables
        this.id = this.nextAvailableID;     // set ID from next available ID
        this.name = name;                   // set name & major from parameters
        this.major = major;
        this.nextAvailableID++;             // increment next available ID
    }

  // Methods

    /**
     * Gets the student's id.
     *      @return the id
     */
    public int getID()
    {
        return this.id;
    }

    /**
     * Gets the student's name.
     *      @return the name
     */
    public String getName()
    {
        return this.name;
    }

    /**
     * Gets the student's major.
     *      @return the major
     */
    public String getMajor()
    {
        return this.major;
    }

}
