446 Object-Oriented Programming Chapter 9 Outline (Dedicated web hosting) 9.1 Introduction
446 Object-Oriented Programming Chapter 9 Outline 9.1 Introduction 9.2 Superclasses and Subclasses 9.3 protected Members 9.4 Relationship between Superclass Objects and Subclass Objects 9.5 Constructors and Finalizers in Subclasses 9.6 Implicit Subclass-Object-to-Superclass-Object Conversion 9.7 Software Engineering with Inheritance 9.8 Composition vs. Inheritance 9.9 Case Study: Point, Circle, Cylinder 9.10 Introduction to Polymorphism 9.11 Type Fields and switch Statements 9.12 Dynamic Method Binding 9.13 final Methods and Classes 9.14 Abstract Superclasses and Concrete Classes 9.15 Polymorphism Examples 9.16 Case Study: A Payroll System Using Polymorphism 9.17 New Classes and Dynamic Binding 9.18 Case Study: Inheriting Interface and Implementation 9.19 Case Study: Creating and Using Interfaces 9.20 Inner Class Definitions 9.21 Notes on Inner Class Definitions 9.22 Type-Wrapper Classes for Primitive Types 9.23 (Optional Case Study) Thinking About Objects: Incorporating Inheritance into the Elevator Simulation 9.24 (Optional) Discovering Design Patterns: Introducing Creational, Structural and Behavioral Design Patterns Summary Terminology Self-Review Exercises Answers to Self-Review Exercises Exercises 9.1 Introduction In this chapter, we discuss object-oriented programming (OOP) and its key component technologies inheritance and polymorphism. Inheritance is a form of software reusability in which new classes are created from existing classes by absorbing their attributes and behaviors and adding new capabilities the new classes require. Inheritance takes advantage of class relationships where objects of a certain class such as a class of vehicles have the same characteristics. Newly created classes of objects are derived by absorbing characteristics of existing classes and adding unique characteristics of their own. An object of class convertible certainly has the characteristics of the more general class automobile, but a convertible s roof goes up and down. Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/7/01