Java, multiple inheritance. How should I do this?

Viewed 594

I am creating a employee wage system. I have an abstract Employee class. WageEmployee and Manager extend Employee. Then Programmer and SalesPerson extend WageEmployee.

My problem is that I want to create a SalesManager. The SalesManger has thier pay computed by adding commission and a salary. So they have type SalesPerson and Manager.

What should I make an interface and what should SalesPerson extend?

It is only natural to extend SalesManager from manager, then make SalesPerson an interface. But I cannot because it inherits from WageEmployee...

How do I get this to work. properly?

abstract class Employee 
{
  String name;

  Employee() {}
  Employee (String nm) { name = nm; }
  abstract double computePay();
  void display () {}
  void setHours(double hrs) {}
  void setSales(double sales) {}
  void setSalary(double salary) { System.out.println("NO!"); }

}

3 Answers
Related