Ex 6: Creating a subclass

NOT TURNED IN

Below is a class called Student. The class Student is a generic class that lists information about the student. You are to design and create two sub-classes of Student called: Undergrad and Graduate.

The class Undergrad should contain: The class Graduate should contain:


You must also create another class called School which has a main() method that creates a few Undergrad and Graduate objects and after setting information prints outs this information to the screen.
class Student {

    String Name;
    int age;
    int SSNum;
    String Advisor;

    void PrintInfo() {
     System.out.println("Name: " + Name);
     System.out.println("age: " + age);
     System.out.println("SS# : " + SSNum);
     System.out.println("Advisor: " + Advisor);
    }
}
    

© Lynne Grewe