1Z0-803 · Question #64
Given: What is the result?
The correct answer is C. Three. In this scenario the overloading method is called with a double/float value, 4.0. This makes the third overload method to run. The Java programming language supportsoverloadingmethods, and Java can distinguish between methods with differentmethod signatures. This means that metho
Question
Given:
What is the result?
Exhibit
Options
- AOne
- BTwo
- CThree
- DCompilation fails
How the community answered
(46 responses)- A11% (5)
- B7% (3)
- C78% (36)
- D4% (2)
Explanation
In this scenario the overloading method is called with a double/float value, 4.0. This makes the third overload method to run. The Java programming language supportsoverloadingmethods, and Java can distinguish between methods with differentmethod signatures. This means that methods within a class can have the same name if they have different parameter lists. Overloaded methods are differentiated by the number and the type of the arguments passed into the method.
Topics
Community Discussion
No community discussion yet for this question.
