Oracle
1Z0-850 · Question #30
1Z0-850 Question #30: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-850 to reveal the answer and full explanation for question #30. The question stem and answer options stay visible for context.
Question
Given:
- class Test {
- public static void main(String args[]) {
- int num1 = 10, num2 = 20, result;
- result = calc(num1, num2);
- System.out.println(result);
- }
- }
- // insert code here
- } Which, inserted at line 8, produces the output 30?
Options
- Astatic int calc(int n1, int n2) { return; }
- Bpublic int calc(int n1, int n2) { return n1 + n2; }
- Cpublic int calc(int n1, int n2) { return; }
- Dstatic int calc(int n1, int n2) { return n1 + n2; }
- Estatic void calc(int n1, int n2) { return (n1 + n2); }
- Fstatic int calc(int n1, int n2) { return n1, n2; };
Unlock 1Z0-850 to see the answer
You've previewed enough free 1Z0-850 questions. Unlock 1Z0-850 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.