• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

a little help with my java assignment?

minofifa

Senior member
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.
 
Are you sure you have public Student (String surname, String firstName, String stdID, int gpa){..} in Student´s class?
If you do, do you have all the parameters initialized?
 
Back
Top