Oracle
1Z0-809 · Question #5
What is the proper way to defined a method that take two int values and returns their sum as an int value?
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; }
How the community answered
(28 responses)- A4% (1)
- B14% (4)
- C4% (1)
- D71% (20)
- E7% (2)
Community Discussion
No community discussion yet for this question.