Inheritance and Polymorphism
(Chapter 11 in Liang's book)
Introduction to inheritance:
The Object Oriented Design methodology
(superclass and subclass):
-------------------------------------------------------- 9/12
Program design using the Object Oriented Design methodology:
Relationship between superclass and subclass and
their constructors:
Assignment 3:
(inheritance, constructor and toString())
The need
to use an overridden method
in the superclass from inside a subclass:
-------------------------------------------------------- 9/14
Overriding vs. overloading:
Java's Object class
and
its toString() method:
Intro to Polymorphism:
Application of polymorphism:
The selection sort algorithm for
integers
The selection sort algorithm for
Circle objects,
Rectangle objects
and
GeometricObject objects
-------------------------------------------------------- 9/19
The mechanism of the polymorphic behavior:
Polymorphism in exception handling:
Assignment 4:
(polymorphism)
Terminology:Upcasting, downcasting and
the
instanceof operator:
-------------------------------------------------------- 9/21
The protected
accessibility classfier:
Preventing a class from being extended by other classes:
Postscript on inheritance:
(1) hiding an inherited variable and
(2) multiple inheritance