nerdexam
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
    1. abstract Dog {
    2. public class Poodle extends Dog {
  • B
    1. class Dog {
    2. public class Poodle extends Dog {
  • C
    1. abstract Dog {
    2. public class Poodle implements Dog {
  • D
    1. abstract class Dog {
    2. public class Poodle implements Dog {
  • E
    1. enum Dog {
    2. public class Poodle implements Dog {
  • F
    1. abstract class Dog {
    2. public class Poodle extends Dog {

How the community answered

(28 responses)
  • A
    4% (1)
  • C
    11% (3)
  • E
    4% (1)
  • F
    82% (23)

Community Discussion

No community discussion yet for this question.

Full 1Z0-850 Practice