Introduction to OOP: Chapter 12: Implications of Inheritance [next] [previous] [audio] [real] [text]

Memory Strategies

How much memory should be set aside for the variable x ?

1.
(Minimum Static Space Allocation) Allocate the amount of space necessary for the base class only. (C++)

2.
(Maximum Static Space Allocation) Allocate the amount of space for the largest subclass.

3.
(Dynamic Space Allocation) Allocate for x only the amount of space required to hold a pointer. (Smalltalk, Java)
Intro OOP, Chapter 12, Slide 5