Introduction to OOP Chapter 11: Static and Dynamic Behavior: next previous audio real text

Static and Dynamic Method Binding

Should the binding for information be associated with the static class of a variable or the dynamic class.

Alice holds a small Mammal - asks Bill ``does this animal give birth to live young''.

Static answer - All mammals give birth to live young - therefore yes.

What if the Mammal is a platypus? Dynamic answer - Platypus lay eggs, therefore no.

Even statically typed OOP languages can use dynamic binding. But may use static type to determine legality of operation.

Intro OOP, Chapter 11, Slide 11