Problem Statement
Which of the following best describes the lifetime of an object?
Explanation
An object’s lifetime begins when it is created (constructor runs), then it exists in a usable state, and ends when it is destroyed or collected. During this time its state is consistent. Understanding object lifetime helps manage memory and resources correctly.
Practice Sets
This question appears in the following practice sets: