public class ExecutiveWithIFace
1: //ExecutiveWithIFace.java
2: //This class implements the NameAndPayInterface.
4: public class ExecutiveWithIFace
5: implements NameAndPayInterface
6: {
7: protected String nameOfWorker;
8: protected double annualSalary;
11: public ExecutiveWithIFace(String name)
12: {
13: nameOfWorker = name;
14: }
16: public void setAnnualSalary(double salary)
17: {
18: annualSalary = salary;
19: }
22: //Here is the implementation of the NameAndPayInterface interface:
23: public String getName()
24: {
25: return nameOfWorker;
26: }
28: public double getGrossWage()
29: {
30: return annualSalary / 12.0 / 4.0;
31: }
32: }