7.2 Inheritance and the Object-Oriented Design Process | 331
Class Name: Work Address Superclass: Company Address Subclasses:
Responsibilities Collaborations
Create itself (name, company, street, city,
state, ZIP code)
Name
Know its street
return String
None
Class Name: Company Address Superclass: Address Subclasses: Work Address,
Box Address
Responsibilities Collaborations
Create itself (name, company, city, state,
ZIP code)
Name
Know its company
return String
None
Class Name: Address Superclass: Subclasses: Home Address,
Company Address
Responsibilities Collaborations
Create itself (name, city, state, ZIP code) Name
Know its name
return String
return String
return String
return String
Name
Know its city
Know its state
None
None
Know its ZIP code None