public class PostGraduateStudent extends Student{
String researchGroup;
PostGraduate(String fn, String ln, Gender g, int nomr, String rg){
super(fn,ln,g,nomr);
researchGroup = rg;
}
public String toString(){
return super.toString() + "," + researchGroup;
}
}
public class Student{
enum Gender{MALE, FEMALE}
//{
String firstName;
String lastName;
Gender gender;
int noOfModulesRegistered;
//}
static double costOfModule = 756.90;
Student(String fn, String ln, Gender g, int nomr){
firstName = fn;
lastName = ln;
gender = g;
noOfModulesRegistered = nomr;
}
When another class is implemented like the example above, can the parameter names differ from the parametrize constructor in the Student class and the parametrize constructor of the PostGraduateStudent Class? Or must the parameter names be the same?
In the PostGraduateStudent what does the word
super means? What is the purpose of the word?