// Derived class from Person, // base class for Executive. public class Employee extends Person { private int id; protected double salary; public Employee(String theName, char theGender, int theAge, int theId, double theSalary) { // Call base class constructor. super(theName, theGender, theAge); // Set the Employee instance variables. id = theId; salary = theSalary; } public int getId( ) { return id; } public double getCompensation( ) { return salary; } public String toString( ) { return String.format("%s %d %.2f", super.toString( ), id, salary); } public static void main(String[ ] args) { Employee p = new Employee("Alice", 'F', 23, 88888, 48000.00); System.out.println("Id for p is " + p.getId( )); System.out.println("Compensation for p is " + p.getCompensation( )); System.out.println("Output of toString for p is "); System.out.println(p); } }