Inheritance: CS 310 Lecture notes

Object-Oriented Programming with Java Lecture Notes

17 February 2009 • Inheritance


Outline

Programs

Class Protocol

Protocol Satisfaction

Satisfaction Example

Observations

The IS-A Relation

IS-A Example

IS-A Abstraction

Inheritance

Implementing IS-A Relations

The Inheritance Relation

Why Inheritance?

Method Overriding

Overriding Methods

Class Compatibility

Compatability Example

Static and Dynamic Types

Type Example

Testing Dynamic Types

Which Method?

Method Look-Up

Method Look-Up Matching

Look-Up Example

Controlling Look-Up

Inheritance Problems

Example.

Example..

Example...

Example....

Preventing Inheritance

Final Overload

Summary

References


This page last modified on 22 February 2008.

Creative
    Commons License