Oracle
1Z0-804 · Question #133
Given: What is the result?
The correct answer is E. The code fails to compile. protected String bark() public class Beagle extends Dog { private String bark() Cannot reduce the visibility of the inherited method from Dog
Java Class Design
Question
Given:
What is the result?
Options
- Awoof arf
- Bwoof woof
- Carf arf
- DA RuntimeException is generated
- EThe code fails to compile
How the community answered
(25 responses)- B4% (1)
- C8% (2)
- D12% (3)
- E76% (19)
Explanation
protected String bark() public class Beagle extends Dog { private String bark() Cannot reduce the visibility of the inherited method from Dog
Topics
#polymorphism#method overriding#compilation#virtual method
Community Discussion
No community discussion yet for this question.