CHAPTER 9 - abstract, there would be no abstract members in...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Java Software Solutions, 4e Lewis/Lofuts Chapter 9 Chapter 9 Exercise Solutions 9.1 Draw and annotate a class hierarchy that represents various types of faculty at a university. Show what characteristics would be represented in the various classes of the hierarchy. Explain how polymorphism could play a role in the process of assigning courses to each faculty member. Faculty (name; salary) Administrative faculty (administrative title; scope of responsibility) College Dean (college name) Department Chair (department name) Coordinator (graduate or undergraduate) Teaching/Research faculty (academic rank; tenured or nontenured; teaching, teaching/research, or research) Professor Associate Professor Assistant Professor Instructor 9.2 What would happen if the pay method were not defined as an abstract method in the StaffMember class of the Firm program? The pay method is the only abstract member of the StaffMember class,. If it were not defined as
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: abstract, there would be no abstract members in the StaffMember class and, except for the abstract declaration in “ abstract public class StaffMember ” it would be possible to instantiate objects of class StaffMember . Further, classes which extend StaffMember would not have to provide their own pay methods, defaulting instead to a pay method with a potentially empty definition. 9.3 Explain how a call to the addMouseListener method represents a polymorphic situation. A call to the addMouseListener method represents a polymorphic situation because the call involves, as a parameter, an object of a class which implements MouseListener , such as DotsListener , or LineListener . Hence, its behavior is determined by the implemented class indicated by the parameter. 9.4 Draw the containment hierarchy for the ViewColors program. Java Software Solutions, 4e Lewis/Lofuts Chapter 9...
View Full Document

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Page1 / 2

CHAPTER 9 - abstract, there would be no abstract members in...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online