Employee Class Hierarchy in Chap. 9

(not the same as the online code)  With added return values in parentheses

                Note that a LegalSecretary IS-A Secretary IS-A Employee, and a Lawyer IS-A Employee

LegalSecretary lucy = new LegalSecretary();  // reference and object both of type LegalSecretary

lucy.getHours() returns ______

lucy.getSalary() returns ______

lucy.takeDictation() works? Y/N

 

Employee lucy1 = lucy;   // reference of type Employee, object of type LegalSecretary

lucy1.getHours() returns ______

lucy1.getSalary() returns ______

lucy1.takeDictation() works? Y/N


Employee leia = new Lawyer();  // ref of type Employee, object of type Lawyer
leia.getSalary()   returns ______
leia.getVacationDays() returns ____