interface EmployeeSpec{ // Declares interface implemented by class Employee String getName(); double getWkPay(); } public abstract class Employee implements EmployeeSpec /** Abstract class to represent an Employee. It may not be instantiated. */ { // fields protected String name; /** name of employee */ protected Date birthDate; /** employee's date of birth */ /* constructors -- note that constructors do not have return type! Even though this constructor cannot be used to generate objects of type Employee, it can be called (via super) in extensions. */ public Employee (String emp_name, Date emp_bday){ /** post: creates Employee object from name and birthdate */ name = emp_name; // initialize fields birthDate = emp_bday; } // methods public String getName() // post: Returns name of Employee { return name; // return name field } public int getAge() /** post: returns the age of the Employee */ { Date today = new Date(); // declares today and set to today's date // declare yearDiff and initialize to diff of years int yearDiff = (today.getYear() - birthDate.getYear()); if ((today.getMonth() > birthDate.getMonth()) || (today.getMonth() == birthDate.getMonth() && today.getDay() > birthDate.getDay())){ return yearDiff; // already had birthday this year } else{ return yearDiff - 1; // adjust age if not had birthday yet this year } } public abstract double getWkPay(); /** post: Return weekly pay. Abstract method that will be overridden in subclasses.*/ /** Not useful to have a main program to test this class since it may not be instantiated. */ }