{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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
Image of page 1

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern