public class Employee extends Person { private double payRate; private String idNum; public Employee() { super(); //invokes constructor from the superclass payRate = 0.0; idNum = "unassigned"; } public Employee(String fn, String ln, double rate, String id) { //invokes one of the constructors from the superclass super(fn, ln); payRate = rate; idNum = id; } public double getPayRate() { return payRate; } public String getIdNum() { return idNum; } public void setPayRate(double rate) { payRate = rate; } public void setIdNum(String id) { idNum = id; } //OVERRIDE: We have overridden the toString method of the superclass // If this method was not here, Java would automatically invoke the superclass' // version of toString // As it happens, we will make use of the superclass' toString inside our method anyways. public String toString() { return ( super.toString() + "\n" + "Id Number: " + idNum + "\n" + "Pay Rate: " + payRate + "\n" ); } //Included here to test overriding public void uselessMethod() { System.out.println("This method called: ueslessMethod was invoked from the class \'Employee\'"); } } //end class Employee