Oracle
1Z0-851 · Question #260
1Z0-851 Question #260: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #260. The question stem and answer options stay visible for context.
Question
Given: public class SuperCalc { protected static int multiply(int a, int b) { return a * b;} } and: public class SubCalc extends SuperCalc{ public static int multiply(int a, int b) { int c = super.multiply(a, b); return c; } } and: SubCalc sc = new SubCalc (); System.out.println(sc.multiply(3,4)); System.out.println(SubCalc.multiply(2,2)); What is the result?
Options
- A12
- BThe code runs with no output.
- CAn exception is thrown at runtime.
- DCompilation fails because of an error in line 21.
- ECompilation fails because of an error in line 22.
- FCompilation fails because of an error in line 31.
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.