exam questions

Exam 1z0-811 All Questions

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

Exam 1z0-811 topic 1 question 5 discussion

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

Given:

And the code fragment:

Which code fragment can be inserted at line n1 to enable the code to print All the best?

  • A. void writeMsg();
  • B. Messenger.writeMsg();
  • C. writeMsg();
  • D. m.writeMsg();
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
electri
4 weeks ago
Selected Answer: C
C is the only correct answer, beaucse line n1 is inside the class "Messenger", it will call the local class function of the instance. So Basicalle "writeMsg();" in position n1 is a short version of "this.writeMsg();".
upvoted 1 times
...
supercoder
2 months, 2 weeks ago
Selected Answer: C
c is correct .
upvoted 1 times
...
Ross_2023
3 months, 4 weeks ago
C is the correct answer because, a method can access another method within a class directly. writeMsg() is an instance method and not a static method. B is incorrect because Messenger.writeMsg() implies as if writeMsg() is a static method. In order B to be correct, keyword "static" should be explicitly declared in writeMsg() method.
upvoted 2 times
...
falchetto
8 months, 1 week ago
B Is wrong. Would be correct if the readMsg was declared as static, but it isn't. Correct answer is C.
upvoted 4 times
...
Olha88
9 months, 4 weeks ago
B is NOT correct answer!
upvoted 2 times
...
yonathanmartinez
1 year, 1 month ago
Se puede llamar el un método publico dentro de otro método dentro de la misma clase
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