I've got a project looking like this :
public interface Payable{
double getPaymentAmount(); // calculate payment; no implementation
} // end interface Payable
then I've got an abstract class like this :
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
// set first name
public void setFirstName( String first )
{
firstName = first; // should validate
} // end method setFirstName
// return first name
public String getFirstName()
{
return firstName;
} // end method getFirstName
// set last name
public void setLastName( String last )
{
lastName = last; // should validate
} // end method setLastName
// return last name
public String getLastName()
{
return lastName;
} // end method getLastName
// set social security number
public void setSocialSecurityNumber( String ssn )
{
socialSecurityNumber = ssn; // should validate
} // end method setSocialSecurityNumber
// return social security number
public String getSocialSecurityNumber()
{
return socialSecurityNumber;
} // end method getSocialSecurityNumber
// return String representation of Employee object
@Override
public String toString()
{
return String.format( "%s %s\nsocial security number: %s",
getFirstName(), getLastName(), getSocialSecurityNumber() );
} // end method toString
// Note: We do not implement Payable method getPaymentAmount here so
// this class must be declared abstract to avoid a compilation error.
} // end abstract class Employee
`
and the last is a public class inherite Employee like this :
*public class SalariedEmployee extends Employee*
and the hint error right here:
"error: SalariedEmployee is not abstract and does not override abstract method getPaymentAmount() in Payable public class SalariedEmployee extends Employee "
I don't know where this comes from. This code is taken from a book and should be perfectly fine. I'm using netbean 8.0 and jdk 1.7