Page 542 - Introduction to Programming with Java: A Problem Solving Approach
P. 542
508 Chapter 13 Inheritance and Polymorphism
13
CHAPTER
Inheritance and Polymorphism
Objectives
• Understand the role of the Object class.
• Learn why you need to redefine the equals and toString methods.
• Learn how polymorphism and dynamic binding improve program versatility.
• Understand what the compiler checks and what the JVM does when a reference variable is associated
with a method name.
• Understand the constraints affecting assignment of an object of one class to a reference variable of another class.
• See how to use an array of ancestor reference variables to implement polymorphism among descendant
methods.
Apago PDF Enhancer
• See how an abstract method declaration in an abstract superclass eliminates the need for a dummy method definition in the superclass.
• See how you can use an interface to specify common method headings, store common constants, and implement multiple polymorphisms.
• Learn where to use protected member access.
• Optionally, learn how to draw a three-dimensional object.
Outline
13.1 Introduction
13.2 TheObjectClassandAutomaticTypePromotion 13.3 TheequalsMethod
13.4 ThetoStringMethod
13.5 PolymorphismandDynamicBinding
13.6 AssignmentsBetweenObjectsinaClassHierarchy 13.7 PolymorphismwithArrays
13.8 AbstractMethodsandClasses
13.9 Interfaces
508