Oracle
1Z0-809 · Question #152
Given: class C2 { public void displayC2() { System.out.println("C2"); } } interface I { public void display(); } class C1 extends C2 implements I { public void display() { System.out.println("C1")…
The correct answer is D. Compilation fails. You've hit your session limit · resets 10:20pm (America/New_York)
Question
Given:
class C2 {
public void displayC2() {
System.out.println("C2");
}
}
interface I {
public void display();
}
class C1 extends C2 implements I {
public void display() {
System.out.println("C1");
}
}
And given the code fragment:
C2 obj1 = new C1();
I obj2 = new C1();
C2 s = obj1;
I t = obj2;
s.display();
t.displayC2();
What is the result?
Options
- AC2C2
- BC1C2
- CC1C1
- DCompilation fails.
How the community answered
(40 responses)- A3% (1)
- B5% (2)
- C15% (6)
- D78% (31)
Explanation
You've hit your session limit · resets 10:20pm (America/New_York)
Community Discussion
No community discussion yet for this question.