Oracle
1Z0-851 · Question #31
1Z0-851 Question #31: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #31. The question stem and answer options stay visible for context.
Question
Given: 01. interface A { public void aMethod(); } 02. interface B { public void bMethod(); } 03. interface C extends A,B { public void cMethod(); } 04. class D implements B { 05. public void bMethod(){} 06. } 07. class E extends D implements C { 08. public void aMethod(){} 09. public void bMethod(){} 10. public void cMethod(){} 11. } What is the result?
Options
- ACompilation fails because of an error in line 3.
- BCompilation fails because of an error in line 7.
- CCompilation fails because of an error in line 9.
- DIf you define D e = new E(), then e.bMethod() invokes the version of bMethod() defined in Line 5.
- EIf you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 5.
- FIf you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.
Unlock 1Z0-851 to see the answer
You've previewed enough free 1Z0-851 questions. Unlock 1Z0-851 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.