Oracle
1Z0-809 · Question #148
1Z0-809 Question #148: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #148. The question stem and answer options stay visible for context.
Question
Given the following classes:
public class Employee {
public int salary;
}
public class Manager extends Employee {
public int budget;
}
public class Director extends Manager {
public int stockoptions;
}
And given the following main method:
public static void main(String[] args) {
Employee employee = new Employee();
Manager manager = new Manager();
Director director = new Director();
//line n1
}
Which two options fail to compile when placed at line n1 of the main method?
Options
- Amanager .stockoption = 500;
- Bdirector .stockoption = 1_000;
- Cdirector .salary = 50_000;
- Demployee .budget = 200_000;
- Eemployee .salary = 50_000;
- Fmanager .budget = 1_000_000;
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.