nerdexam
Oracle

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

Using Operators and Decision Constructs

Question

Given:

What is the result?

Exhibit

1Z0-803 question #40 exhibit

Options

  • AOne
  • BTwo
  • CThree
  • DCompilation fails

How the community answered

(42 responses)
  • A
    5% (2)
  • B
    5% (2)
  • C
    2% (1)
  • D
    88% (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

#compilation error#switch statement#control flow#syntax

Community Discussion

No community discussion yet for this question.

Full 1Z0-803 Practice