Employee and Programmer

Report a typo

There are two classes: Employee and Programmer.

class Employee {
    
    protected long baseSalary;

    public Employee(long baseSalary) {
        this.baseSalary = baseSalary;
    }

    public long calcSalary() {
        return baseSalary;
    }
}

class Programmer extends Employee {

    private int yearsOfExperience;
    
    public Programmer(long baseSalary, int yearsOfExperience) {
        super(baseSalary);
        this.yearsOfExperience = yearsOfExperience;
    }

    // overridden calcSalary
}

Select a correctly overridden method calcSalary in the class Programmer.

Select one option from the list
___

Create a free account to access the full topic