An Introduction to Object-Oriented Programming
By Timothy Budd
Study Guide for Chapter 4
Learning Objectives
After reading this chapter, you should be able to:
-
Describe the message passing mechanisms of several programming languages.
-
Understand the difference between heap-based and stack-based storage
allocation.
-
Understand the difference between explicit dynamic memory recovery and
implicit (garbage collection) memory recovery.
-
Describe the mechanisms for creation and initialization in several
programming languages.
Study Questions
You may wish to use the print or save as command
on your web browser to produce a copy of this study guide.
That way you can fill in the answers to the questions as part of
your assimilating the information you learn in this chapter.
-
In what ways does message passing differ from a procedure call?
-
What are the three portions of a message passing expression?
-
In what ways does stack based memory allocation differ from heap based
memory allocation?
-
What is meant by the assertion that in Pascal naming and
allocation of dynamic variables are tied, whereas in C
they are separate.
-
What does it mean to say a language uses garbage collection to recover
no-longer used dynamically allocated memory?
-
What are some arguments for and against the use of automatic garbage collection?
-
How is the lifetime of a value different from the scope of
a variable?
-
What does it mean to say a variable is immutable?
Contents copyright
Timothy Budd, 1995.