/** * Basic student class * Student "extends" the Person class * Thus it inherits all the methods and instance variables from Person */ public class Student extends Person { /** * Default constructor * If you don't specify a default constructor * the compiler will provide one for you that initializes * all variables to their default values. */ public Student() { // explicit call to student's superclass constructor // superclass constructor must be call before anything else // is done super(); studentID = 00000000; } /** * Retrieves the student's id * @return student id */ public int getStudentID() { return this.studentID; } /** * Sets the student's id. * @param id new student id */ public void setStudentID(int id) { this.studentID = id; } /** * Method returns the String representation of a Student * This method overrides the toString() method in the object class * @return String representation */ public String toString() { return this.getFullName() + " " + studentID; } /** * instance variables - studentID can only be seen by Student */ private int studentID; }