Java Reference
In-Depth Information
Firm
+ main (args : String[]) : void
StaffMember
Staff
# name : String
# address : String
# phone : String
- staffList : StaffMember[]
+ payday() : void
+ toString() : String
+
pay
() : double
Volunteer
Employee
# socialSecurityNumber : String
# payRate : double
+ pay() : double
+ toString() : String
+ pay() : double
Executive
Hourly
- bonus : double
- hoursWorked : int
+ awardBonus (execBonus : double) : void
+ pay() : double
+ addHours (moreHours : int) : void
+ pay() : double
+ toString() : String
FIGURE 10.1
A class hierarchy of employees
The
StaffMember
class contains a
toString
method to return the information
managed by the
StaffMember
class. It also contains an abstract method called
pay
, which takes no parameters and returns a value of type
double
. At the generic
StaffMember
level, it would be inappropriate to give a definition for this method.
Search WWH ::
Custom Search