Oracle
1Z0-850 · Question #23
Given: 5. // insert code here 6. public abstract void bark(); 7. } 8. // insert code here 9. public void bark() { 10. System.out.println("Woof"); 11. } 12. } 13. } Which, inserted at lines 5 and 9…
The correct answer is F. 5. abstract class Dog { 9. public class Poodle extends Dog {. See the full explanation below for the reasoning.
Question
Given:
5. // insert code here
6. public abstract void bark();
7. }
8. // insert code here
9. public void bark() {
10. System.out.println("Woof");
11. }
12. }
13. }
Which, inserted at lines 5 and 9, allows the file to compile?
Options
- A
- abstract Dog {
- public class Poodle extends Dog {
- B
- class Dog {
- public class Poodle extends Dog {
- C
- abstract Dog {
- public class Poodle implements Dog {
- D
- abstract class Dog {
- public class Poodle implements Dog {
- E
- enum Dog {
- public class Poodle implements Dog {
- F
- abstract class Dog {
- public class Poodle extends Dog {
How the community answered
(28 responses)- A4% (1)
- C11% (3)
- E4% (1)
- F82% (23)
Community Discussion
No community discussion yet for this question.