// P.119 // #4(a) public class Employee extends Person { // instance var. private int serviceYear; // constructors public Employee() { super(); serviceYear=0; } public Employee(String N, int Y) { super(N); serviceYear = Y; } // two methods: salary, toString? public int salary() { return 30000+2000*serviceYear; } public String toString() { return super.toString() + ", Salary: " + salary(); } }