Code reuse in Java
If I define class Employee with instance variables string first name,last name(general attribut of a peson or employee) and then I define new class Commissionemployee extended from employee, with class instance variables double grossSales and double commissionRate. And finally I define new class BasePlusCommissionEmployee with private instance variable double baseSalary which is extended from class CommissionEmployee, please tell me how the constructor of class BasePlusCommission looks like? We know that it Will be code reuse since class CommissionEmployee is a direct superclass of BasePlusCommissionEmployee, and the class' Employee (or Person) is an indirect superclass of class BasePlusCommissionEmployee. We know that this is multilevel or hierarchical inheritance and there will be code-reuse, chaining call to the constructor of direct superclass and Indirect superclass. My code doesn't run successfiully. Use private inheritance for convenience and good software engineering please? https://code.sololearn.co