exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 159 discussion

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

Given the code fragment:

Which two modifications enable the code to compile? (Choose two.)

  • A. Make the method at line 8 protected.
  • B. Make the method at line 8 public.
  • C. Make the method at line 10 protected.
  • D. Make the method at line 4 public.
  • E. Make the method at line 2 public.
Show Suggested Answer Hide Answer
Suggested Answer: AC 🗳️

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
MPignaProTech
2 months, 3 weeks ago
Selected Answer: AB
AB is the good answer
upvoted 1 times
...
7df49fb
9 months, 4 weeks ago
A and B only
upvoted 1 times
...
RAADEL3IMLAK
1 year, 11 months ago
sorry for my answer i have tested A and C is good answer
upvoted 1 times
...
RAADEL3IMLAK
1 year, 11 months ago
in this case the only two good ones represent its A and B, the Implementation of an abstract method in the child class can be private in note case it does not prevent the compilation, instead the method revolve and declared protected so the child class this method can be declared minimum protected or lower public, thus the answer and A, B
upvoted 2 times
...
akbiyik
2 years, 1 month ago
The answer would be BC or AC.
upvoted 1 times
...
carloswork
2 years, 2 months ago
Selected Answer: AC
The answer whould be BC or AC. Both A and B are correct answers unfortunately. Note that in these options what is being analyzed is an override and not an implementation of an abstracted method. The oracle documentation states that the access modifier in this case could be the same or allow for greater visibility, not less. Which makes options A and B correct. If the question is correct, it remains to be seen what is the best practice or convention in this regard. https://docs.oracle.com/javase/tutorial/java/IandI/override.html About the answer: I choose AC. Whereas, the abstract class is a pseudo-model to follow. I would keep the same access modifier already informed in it. Another no less relevant issue is having confidence in this simulated exam material that being the knowledge base for us. We wait for new comments in this forum to improve the accuracy in the answer.
upvoted 1 times
...
iSnover
2 years, 3 months ago
Selected Answer: BC
The question was asked wrong, because in addition to answers A and C being correct, B is also correct. So both AC and BC are correct, because in inheritance you can put a view pattern bigger than the parent class, you just can't put it smaller. Attention to the question because she didn't talk about independent changes so it can't be AB.
upvoted 1 times
iSnover
2 years, 3 months ago
If the question falls on the test I would mark BC, I don't know if they score the most correct. To be on the safe side, I would mark BC.
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