Oracle
1Z0-851 · Question #37
1Z0-851 Question #37: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #37. The question stem and answer options stay visible for context.
Question
Given: 01. class Super { 02. private int a; 03. protected Super(int a) { this.a = a; } 04. } 11. class Sub extends Super { 12. public Sub(int a) { super(a); } 13. public Sub() { this.a = 5; } 14. } Which two, independently, will allow Sub to compile? (Choose two.)
Options
- AChange line 2 to: public int a;
- BChange line 2 to: protected int a;
- CChange line 13 to: public Sub() { this(5); }
- DChange line 13 to: public Sub() { super(5); }
- EChange line 13 to: public Sub() { super(a); }
Unlock 1Z0-851 to see the answer
You've previewed enough free 1Z0-851 questions. Unlock 1Z0-851 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.