nerdexam
Oracle

1Z0-809 · Question #5

1Z0-809 Question #5: Real Exam Question with Answer & Explanation

The correct answer is D. int sum(int first, int second) { return (first + second); }. See the full explanation below for the reasoning.

Question

What is the proper way to defined a method that take two int values and returns their sum as an int value?

Options

  • Aint sum(int first, int second) { first + second; }
  • Bint sum(int first, int second) { return first + second; }
  • Csum(int first, int second) { return first + second; }
  • Dint sum(int first, int second) { return (first + second); }
  • Evoid sum(int first, int second) { return first + second; }

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice