AP Computer Science

Tuesday, March 28, 2006

Mon 3/27

Abstract classes, interfaces, inheritance

Tue 3/28

Programming project - p. 449 7.2

Make Employee abstract
Attributes (data members)
• name, id
Behaviors (methods)
• constructors
• get, set, toString
• abstract method --> work

Individual Employees extend Employee
• constructors use super
• override the work method
• override the toString method, but use
• super (see p. 398) output name and job
• create a few extra methods in extended classes
• e.g. Administrator has a department, get and set it
• Nurse has a number of patients
• main should have objects of each class as well as
• array of Employee(s)

0 Comments:

Post a Comment

<< Home