// Program to demonstrate the basics of inheritance. // // Notice that each type of employee has their own results when // the program is run, and that some types of employees have // behavior specific to them. public class EmployeeClient { public static void main(String[] args) { Employee[] staff = { new Employee(), new Assistant(), new Lawyer(), new LegalAssistant() }; for (int i = 0; i < staff.length; i++) { Employee worker = staff[i]; System.out.print(worker.getHours() + " hours/week, "); System.out.printf("$%.2f, ", worker.getSalary()); System.out.print(worker.getVacationDays() + " vacation days, using "); System.out.println(worker.getVacationForm() + " form"); } } // System.out.println("Employee: "); // Employee eddie = new Employee(); // System.out.print(eddie.getHours() + " hours/week, "); // System.out.printf("$%.2f, ", eddie.getSalary()); // System.out.print(eddie.getVacationDays() + " vacation days, using "); // System.out.println(eddie.getVacationForm() + " form"); // // eddie.bookMeeting("1:20pm"); // System.out.println(); // // System.out.println("Assistant: "); // Assistant al = new Assistant(); // System.out.print(al.getHours() + " hours/week, "); // System.out.printf("$%.2f, ", al.getSalary()); // System.out.print(al.getVacationDays() + " vacation days, using "); // System.out.println(al.getVacationForm() + " form"); // al.bookMeeting("12:00pm"); // System.out.println(); // // System.out.println("Legal Assistant: "); // LegalAssistant lou = new LegalAssistant(); // System.out.print(lou.getHours() + " hours/week, "); // System.out.printf("$%.2f, ", lou.getSalary()); // System.out.print(lou.getVacationDays() + " vacation days, using "); // System.out.println(lou.getVacationForm() + " form"); // lou.bookMeeting("3:00pm"); // lou.fileLegalBrief(); // System.out.println(); // } }