Professional Documents
Culture Documents
LAB02:
In this exercise you will write a class Undergraduate.java that inherits the
Student class.
Undergraduate class has the following data:
int level which describes the year of study.(1: firstYear,2: SecondYear,3:
ThirdYear,4: ForthYear)
The Undergraduate class contains the following constructors:
_public Undergraduate(String name, long id):this constructor initialize
the level with the value 1
_Override toString() for this class, this method returns a strings with all
the data of Undergraduate student.
_Write another class named Graduate, the class has the following data:
GradID.
_Write the constructor method for this class: Graduate(String name, long
id, long gradID)to initialize the object data.
Write a copy constructor public Graduate(Graduate other) that constructs
Graduate object with Graduate object as a parameter.