| preferred AP College board partner for AP classes
AP Computer Science A/Unit 9: Inheritance
Start Practice TestPractice Test
About Exam
easy
Calling Superclass Constructors
< Prev
Next >

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);

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy