Introduction to OOP
Chapter 12: Implications of substitution:
next
previous
audio
real
text
Dynamic Memory Allocation
In the third approach, all objects are actually pointers.
Only enough space for a pointer is allocated at compile time.
Actual data storage is allocated on the heap at run-time.
Used in Smalltalk, Object Pascal, and Objective-C, Java.
Requires user to explicitly allocate new objects and, in some languages, explicitly free no longer used storage.
May also lead to pointer semantics for assignment and equality testing.
Intro OOP,
Chapter 12
, Slide 12