Calling Superclass Constructors
Refer to the following classes.
public class Student
{
private int gradYear;
private double gpa;
/* other implementation not shown */
}
public class UnderClassman extends Student
{
private int homeRoomNum;
private String counselor;
/* other implementation not shown */
}
public class Freshman extends UnderClassman
{
private int middleSchoolCode;
/* other implementation not shown */
}
Assume that all three classes contain parameterized constructors with the following declarations and that all variables are logically named.
public Student (int gradYear, double gpa)
public UnderClassman (int gradYear, double gpa, int homeRoomNum, String counselor)
public Freshman (int gradYear, double gpa, int homeRoomNum, String counselor, int middleSchoolCode)
Which of the following calls to super would appear in the constructor for the Freshman class?
A
super();
B
super(gradYear, gpa, homeRoomNum, counselor);
C
super(homeRoomNum, counselor);
D
super(gradYear, gpa, homeRoomNum, counselor, middleSchoolCode);
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE