Chapter 7
Inheritance

Chapter Objectives

• Derive new classes from existing ones.
• Explain how inheritance supports software reuse.
• Add and modify methods in child classes.
• Discuss how to design class hierarchies.
• Define polymorphism and how it can be done.
• Discuss the use of inheritance in Java GUI framework.
• Examine and use the GUI component class hierarchy.
Chapter Objectives

I. Object Oriented Program Design
A. Program Design
3. Read and understand class
specifications and relationships
among the classes(“is-a”, “has-a”
relationships)
II. Program Implementation
B. Programming Constructs
2. Declaration

Day
Create subclasses


NOTES -Powerpoint
read 381-90
fig 7-3

Words.java
Book.java
Dictionary.java

LAB 7.1 or 7.2 on page 449

HW 4/5
Do Carlot program -see below

Day
Class hierarchies

Read "the object class p394
Academia.java
Student.java
StudentAthlete.java

HW
read pages 399-400
R
un Pets.java page 401

Questions on page

Day
Polymorphism

read pages 409-419

Run Firm.java

HW
read pages
Questions on page

LAB

Day
Place holder
PowerPoint


HW
read pages
Questions on page
Day
Place holder
PowerPoint


HW
read pages
Questions on page
Day
Place holder
PowerPoint


HW
read pages
Questions on page
Day
Place holder
PowerPoint


HW
read pages
Questions on page
Day
Place holder
PowerPoint


HW
read pages
Questions on page
Carlot program

1. Main method called Carlot

2. Construct a parent class that makes car objects with make, year, and color

3. Construct a child classes that makes car objects that also has model info.

4. print out what cars are in the lot-also print out all the descriptions.