January 2014
Intermediate to advanced
736 pages
70h 43m
English
Let’s reexamine our hierarchy once more, this time using good software engineering practices. Class CommissionEmployee (Fig. G.10) declares instance variables firstName, lastName, socialSecurityNumber, grossSales and commissionRate as private (lines 6–10) and provides public methods setFirstName, getFirstName, setLastName, getLastName, setSocialSecurityNumber, getSocialSecurityNumber, setGrossSales, getGrossSales, setCommissionRate, getCommissionRate, earnings and toString for manipulating these values. Methods earnings (lines 93–96) and toString (lines 99–107) use the class’s get methods to obtain the values of its instance variables. ...
Read now
Unlock full access