Chapter 11

Static and Dynamic Behavior

Much of the power of object-oriented languages derives from the ability of objects to change their behavior dynamically at run time. Understanding object-oriented programming mechanisms therefore requires an appreciation of the differences between static and dynamic behavior and the implications of this difference.

In programming languages, the term static almost always refers to a property or feature that is bound at compile time and cannot thereafter be modified. A statically typed variable, for example, means that the type associated with the variable is set at compile time and cannot change during the course of execution. The term dynamic, on the other hand, almost always refers to a property or feature ...

Get An Introduction to Object-Oriented Programming, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.