Exam Review 0

One-page version suitable for printing.

Question 0-1

Describe the purpose of the tombstone in the context of the copy collection technique for garbage collection.

Solution

Question 0-2

Suppose we have the following sequence of declarations in C++.

class A { };
class B : public A { };
class C : public A { };
class D : public B, C { };
Note that the following would be legal in C++.
B *b = new D();
Why would C++ prohibit the following statement?
A *a = new D();

Solution

Question 0-3

C++ distinguishes regular inheritance from virtual inheritance. Explain this distinction.

Solution

Question 0-4

How does a Smalltalk system store class methods internally?

Solution

Question 0-5

Explain why a subclass's CIR format should begin by matching the CIR format of its superclass.

Solution