Hi

Just copy this code below in a java file and name it "SalesStaff.java" and try to compile it.
It will compile successfully as it did for me.
Code: JAVA
class Employee {
    //instance variables
    private String fName;
    private String sName;
    private String payReference;
    private double annualSalary;
    //constructor
    public Employee (String inputName, String inputSurname, String inputPayRef, double inputSalary)
    {
        fName = inputName;
        sName = inputSurname;
        payReference = inputPayRef;
        annualSalary = inputSalary;
    }
    //The next 4 methods are ACCESSOR methods
    public String getfName(){
        return fName;
    }
    public String getsName(){
        return sName;
    }
   
    public String getPayReference(){
        return payReference;
    }
    public double getSalary(){
        return annualSalary;
    }
    //The next 4 methods are SETTING methods
    public void setName(String newName){
        fName = newName;
    }
    public void setsName(String newsName){
        sName = newsName;
    }
    public void setPayReference(String newPayRef){
        payReference = newPayRef;
    }
    public void setSalary(double newSalary){
        annualSalary = newSalary;
    }
   
    public void showDetails(){
        System.out.println("Employee Name     : " + this.getfName()  );
        System.out.println("Employee Surname     : " + this.getsName()  );
        System.out.println("Pay Reference         : " + this.getPayReference());
        System.out.println("Annual Salary         : " + this.getSalary());
    }
   
}//End of class definition




public class SalesStaff extends Employee {
    //instance variables
    double bonusPoints;
    //constructor
    public SalesStaff (String inputName, String inputSurname, String inputPayRef, double inputSalary,String inputCar)
    {
        super (inputName , inputSurname , inputPayRef ,inputSalary);
       
    }
   
    //other methods
    private double bonusPoints (){
        return super.getSalary() / 52.0 + bonusPoints * 20;
    }
   
   
    public void showDetails(){
        super.showDetails();
    }
   
}//End of class definition
 
Regards
Amit Dave