| preferred AP College board partner for AP classes
AP Computer Science A/Unit 9: Inheritance
Start Practice TestPractice Test
About Exam
easy Solved by 4 students
Implicit Superclass Constructor Call
< Prev
Next >

Consider the following class declarations. What is printed as a result of executing the main method in the Child class?

public class Parent {
    public Parent() { 
        System.out.print("Parent "); 
    }
}

public class Child extends Parent {
    public static void main(String[] args) {
        new Child();
    }
}
A

Parent Child

B

Compilation Error

C

Parent

D

Child

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: apfive@apfive.org|Privacy Policy