Introduction to OOP
Chapter 11: Static and Dynamic Behavior:
A statically typed language associated types with variables, a dynamically typed language associates types with values.
Static typing gives better error detection, better run-time efficiency, less flexibility.
In a statically typed OO language, an object variable can still hold values from a child class.
The static class is the class of the declaration, the dynamic class is the class of the value currently held.
The legality of a message is checked using the static class.
A message can be bound to a method using either the static or dynamic class. Most languages use the dynamic class. Some languages allow the programmer to choose which method is used.
, Slide 15