CS 70

Lesson 2

  • LHS Cow speaking

    In this lesson, we're going to spend some time reflecting on the when and the how of object lifetime, for both primitives and instances of classes.

  • RHS Cow speaking

    We'll also look at how references, arrays, and data members interact with object lifetime.

  • LHS Cow speaking

    We will be reviewing many things we already know or at least intuit but we'll be folding in some new details and unifying a number of concepts.

This lesson addresses the following course-learning goals from Group 5 (Object Lifetime):

  • Goal 5B (Lifetime Timing):
    • Identify where in a program each phase of lifetime (allocation, initialization, use, destruction, deallocation) happens for an instance of a class.
  • Goal 5C (Pointers to Classes):
    • Explain how references and pointers to instances of classes behave in terms of object lifetime

Outline

(This would be a good spot for a break.)

(Maybe take a quick break before we tie it all up.)

To receive credit: complete all pages above, then this page will be complete as well (and get a green check emoji at the bottom right of the page).

(When logged in, completion status appears here.)