I have a superclass (Employee) which implements an interface which contains only 1 method, as follows.

```
public interface Payable 
{    
   double getPaymentAmount(); // calculate payment; no implementation
}

```

I've got a number of subclasses which inherit from Employee (e.g. SalariedEmployee, HourlyEmployee, CommissionEmployee), each of which contain a method earnings.

I've been asked to "can modify class Employee to implement interface Payable and declare method getPaymentAmount to invoke method earnings. Method getPaymentAmount would then be inherited by the subclasses in the Employee hierarchy. When getPaymentAmount is called for a particular subclass object, it polymorphically invokes the appropriate earnings method for that subclass".

How do I call the relevant method for earnings in the Employee class method getPaymentAmount without editing the subclasses?

I'm a relative newbie to Java.

The relevant part of the Employee class is as follows:

```
public abstract class Employee implements Payable
{
   private String firstName;
   private String lastName;
   private String socialSecurityNumber;

   // three-argument constructor
   public Employee( String first, String last, String ssn )
   {
      firstName = first;
      lastName = last;
      socialSecurityNumber = ssn;
   } // end three-argument Employee constructor
    //getters, settters, toString override etc have been deleted. 
   public double getPaymentAmount()
   {
       ????    //This is what I need help with.        
   }

} // end abstract class Employee

```

and taking 1 example of the subclass:

```
public class SalariedEmployee extends Employee
{

    private double weeklySalary;

    // four-argument constructor
    public SalariedEmployee(String first, String last, String ssn, double salary)
    {
        super(first, last, ssn); // pass to Employee constructor
        setWeeklySalary(salary); // validate and store salary
    } // end four-argument SalariedEmployee constructor

    @Override
    public double earnings()
    {
        return getWeeklySalary();
    } // end method earnings

} // end class SalariedEmployee

```