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:
- abstract class Shape {
- Shape ( ) { System.out.println ("Shape"); }
- protected void area ( ) { System.out.println ("Shape"); }
- }
- class Square extends Shape {
- int side;
- Square (int side) {
- /* insert code here */
- this.side = side;
- }
- public void area ( ) { System.out.println ("Square"); }
- }
- class Rectangle extends Square {
- int len, br;
- Rectangle (int x, int y) {
- /* insert code here */
- len = x; br = y;
- }
- void area ( ) { System.out.println ("Rectangle"); }
- } 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.