1Z0-803 · Question #40
Given: What is the result?
The correct answer is D. Compilation fails. Overloading of the x method fails as the input argument in all three cases are double. To use overloading of methods the argument types must be different. Note: The Java programming language supports overloading methods, and Java can distinguish between methods with different met
Question
Given:
What is the result?
Exhibit
Options
- AOne
- BTwo
- CThree
- DCompilation fails
How the community answered
(42 responses)- A5% (2)
- B5% (2)
- C2% (1)
- D88% (37)
Explanation
Overloading of the x method fails as the input argument in all three cases are double. To use overloading of methods the argument types must be different. Note: The Java programming language supports overloading methods, and Java can distinguish between methods with different method signatures. This means that methods within a class can have the same name if they have different parameter lists
Topics
Community Discussion
No community discussion yet for this question.
