nerdexam
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:
  1. class Test {
  2. public static void main(String args[]) {
  3. int num1 = 10, num2 = 20, result;
  4. result = calc(num1, num2);
  5. System.out.println(result);
  6. }
  7. }
  8. // insert code here
  9. } 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.

Full 1Z0-850 Practice