Implicit Superclass Constructor Call
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
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE