Introduction to OOP
Chapter 12: Implications of substitution:
next
previous
audio
real
text
Problems with Pointer Semantics
If x is assigned to y and then changes are made to x, are these changes reflected in y?
If x is explicitly freed, what happens if the user tries to access memory through y?
In C++, programmer can make assignment (equality testing) mean anything they want.
Object Pascal, Java uses pointer semantics, no built-in provision for copies.
Smalltalk and Objective-C use pointer semantics, have several techniques for making copies.
Intro OOP,
Chapter 12
, Slide 15