Oracle
1Z0-809 · Question #157
1Z0-809 Question #157: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #157. The question stem and answer options stay visible for context.
Question
Given:
class A {
public A() {
System.out.print("A ");
}
}
class B extends A {
public B() {
System.out.print("B "); //line n1
}
}
class C extends B {
public C() {
System.out.print("C "); //line n2
}
public static void main(String[] args) {
C c = new C();
}
}
What is the result?
Options
- AC B A
- BA B C
- CC
- DCompilation fails at line n1 and line n2.
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.