Oracle
1Z0-803 · Question #240
1Z0-803 Question #240: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-803 to reveal the answer and full explanation for question #240. The question stem and answer options stay visible for context.
Question
Given: package p1; public interface DoInterface { void method1(int n1); // line n1 } package p3; import p1.DoInterface; public class DoClass implements DoInterface { public DoClass(int p1) { } public void method1(int p1) { } // line n2 private void method2(int p1) { } // line n3 } public class Test { public static void main(String[] args) { DoInterface doi= new DoClass(100); // line n4 doi.method1(100); doi.method2(100); } } Which change will enable the code to compile?
Options
- AAdding the public modifier to the declaration of method1 at line n1
- BRemoving the public modifier from the definition of method1 at line n2
- CChanging the private modifier on the declaration of method 2 public at line n3
- DChanging the line n4 DoClass doi = new DoClass ( );
Unlock 1Z0-803 to see the answer
You've previewed enough free 1Z0-803 questions. Unlock 1Z0-803 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.