When i run this code
-------------------------------
public class Undergrad extends Student {
private String major;
private String minor;
/* when called, the constructor for "Undergrad" sets up the proper fields, including major and minor
* It takes two strings as perameters.
*/
public Undergrad (String surname, String firstName, String stdID, int gpa, String minor, String major){
super(surname,firstName,stdID,gpa);
this.minor = minor;
this.major = major;
}
------------------------------------------
i get the following error
"implicit suprconstructor Student() is undefined, must explicitly invoke another constructor.
it is true that i don't hae a Student() constructor defined in my superclass (that takes no perameters). i don't want ther to be one. i only want the one that i made to be called by the subclass when i pass it the proper perameters. My Student constructor looks like this:
public Student (String surname, String firstName, String stdID, int gpa){..}.
any ideas on how to fix this? thanks.
-------------------------------
public class Undergrad extends Student {
private String major;
private String minor;
/* when called, the constructor for "Undergrad" sets up the proper fields, including major and minor
* It takes two strings as perameters.
*/
public Undergrad (String surname, String firstName, String stdID, int gpa, String minor, String major){
super(surname,firstName,stdID,gpa);
this.minor = minor;
this.major = major;
}
------------------------------------------
i get the following error
"implicit suprconstructor Student() is undefined, must explicitly invoke another constructor.
it is true that i don't hae a Student() constructor defined in my superclass (that takes no perameters). i don't want ther to be one. i only want the one that i made to be called by the subclass when i pass it the proper perameters. My Student constructor looks like this:
public Student (String surname, String firstName, String stdID, int gpa){..}.
any ideas on how to fix this? thanks.
