exam questions

Exam 1z0-811 All Questions

View all questions & answers for the 1z0-811 exam

Exam 1z0-811 topic 1 question 16 discussion

Actual exam question from Oracle's 1z0-811
Question #: 16
Topic #: 1
[All 1z0-811 Questions]

Given:

What is the result?

  • A. 300
  • B. 100
  • C. 200
  • D. A compilation error occurs.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
supercoder
2 months, 1 week ago
Selected Answer: D
same signature , that is , method with same name and same number of arguments with same type of arguments Duplicate add(int x)
upvoted 1 times
...
supercoder
2 months, 1 week ago
Selected Answer: D
same signature , that is , method with same name and same number of arguments with same type of arguments
upvoted 1 times
...
Coolman26
3 months, 3 weeks ago
Selected Answer: D
As said above, you cannot duplicate the name of the method without changing the arguments.
upvoted 1 times
...
CuriosityYen
7 months, 2 weeks ago
Selected Answer: D
Duplicate Method Signature: The class has two methods with the same name and parameter types but different return types, which is not allowed. The method add(int x) has a conflicting declaration as both public int add(int x) and public void add(int x).
upvoted 4 times
...
LionNish
10 months, 3 weeks ago
This code compiles properly we can define duplicate methods it will not throw a error in compiling so correct answer is C
upvoted 1 times
filco72
4 months ago
I tested myself and it is not compiling
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago