nerdexam
Oracle

1Z0-809 · Question #48

1Z0-809 Question #48: Real Exam Question with Answer & Explanation

Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #48. The question stem and answer options stay visible for context.

Question

Given:
  1. abstract class Shape {
  2. Shape ( ) { System.out.println ("Shape"); }
  3. protected void area ( ) { System.out.println ("Shape"); }
  4. }
  5. class Square extends Shape {
  6. int side;
  7. Square (int side) {
  8. /* insert code here */
  9. this.side = side;
  10. }
  11. public void area ( ) { System.out.println ("Square"); }
  12. }
  13. class Rectangle extends Square {
  14. int len, br;
  15. Rectangle (int x, int y) {
  16. /* insert code here */
  17. len = x; br = y;
  18. }
  19. void area ( ) { System.out.println ("Rectangle"); }
  20. } Which two modifications enable the code to compile?

Options

  • AAt line 1, remove abstract
  • BAt line 9, insert super();
  • CAt line 12, remove public
  • DAt line 17, insert super (x);
  • EAt line 17, insert super (); super.side = x;
  • FAt line 20, use public void area () {

Unlock 1Z0-809 to see the answer

You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full 1Z0-809 Practice