Oracle
1Z0-815 · Question #83
Given: class Overloading { int x(double d) { System.out.println("one"); return 0; } String x(double d) { System.out.println("two"); return null; } double x(double d) { System.out.println("three")…
The correct answer is D. Compilation fails. See the full explanation below for the reasoning.
Question
Given:
class Overloading { int x(double d) { System.out.println("one"); return 0; } String x(double d) { System.out.println("two"); return null; } double x(double d) { System.out.println("three"); return 0.0; } public static void main(String[] args) { new Overloading().x(4.0); } } What is the result?
Options
- Aone
- Btwo
- Cthree
- DCompilation fails.
How the community answered
(37 responses)- A3% (1)
- B8% (3)
- C16% (6)
- D73% (27)
Community Discussion
No community discussion yet for this question.