Oracle 1Z0-808 Exam question no. 19

Q.– Given:-

public class Employee   {
               public int salary; 

public class Manager extends Employee   {
               public int budget; 

public class Director extends Manager      { 
              public int stockOptions; 


And given this main method: 

  public static void main(String[ ] args) { 
              Employee employee = new Employee(); 
              Employee manager = new Manager(); 
              Employee director = new Director(); 
              //line n1 
  }

Which two options compile when placed at line n1 of the main method? 

A) director.stockOptions = 1_000; 

B) director.salary = 80_000; 

C) employee.budget = 200_000; 

D) manager.budget = 1_000_000; 

E) employee.salary = 50_000;  

F) manager.stockOptions = 500; 


⧪ please give your answer in a comment section.

Post a Comment

8 Comments