super
isn't a method; it's a keyword. Under certain contexts it may be called or used as a method, but it's really a keyword. The link above will give you tons of helpful info about that, as well as some tidbits on inheritance.
That aside, what it sounds like is that you have a straightforward relationship between two entities:
A
Diploma
should be the base entity that you're using; it holds information such as the recipient's name, their GPA, and what degree subject they're receiving it for.A
DiplomaWithHonors
sounds like it's a different type of honor for the differing GPA.
A very primitive structure may look something like this. Assume fields are defined.
public class Diploma {
public Diploma(String name, double GPA, String degreeField, DiplomaType diplomaType) {
this.name = name;
this.GPA = GPA;
this.degreeField = degreeField;
this.diplomaType = diplomaType;
}
}
public class DiplomaWithHonors extends Diploma {
public DiplomaWithHonors(String name, double GPA, String degreeField, DiplomaType diplomaType) {
super(name, GPA, degreeField, diplomaType);
calculateHonors();
}
}
Notice that super
in the context of a constructor has to be the first thing referenced inside of that constructor.