Ch 6. Polymorphism

5/31/00


Click here to start


Table of Contents

Ch 6. Polymorphism

Introduction

C++ does not include the concept of interface.

Figure 6.1 Animal Kingdom in Java

Figure 6.2 Animal Kingdom in C++

Virtual & Non-virtual Overriding

Example of overriding

Impact of Virtual on Size

Obtaining Type Information from a Dynamic Value

Abstract Classes

Abstract Classes

Example of Abstract Classes

Downcasting (Reverse Polymorphism)

Downcasting (Reverse Polymorphism)

Example of Downcasting

Simulating the Dynamic Cast

Simulating the Dynamic Cast

Name Resolution

Name Resolution

A Forest, Not a Tree

Virtual Destructors

Example of Destructors

Private Inheritance

Private Inheritance

Example of Private Inheritance

Inheritance and Arrays

Overloading

Overloading

Author: Seung Sean Yoo

Email: budd@cs.orst.edu

Home Page: http://www.cs.orst.edu/~budd