Chapter 8. Object Lifetime

Exam Objectives

  • State the behavior that is guaranteed by the garbage collection system.

  • Write code that explicitly makes objects eligible for garbage collection.

  • Recognize the point in a piece of source code at which an object becomes eligible for garbage collection.

Supplementary Objectives

  • Write code that makes proper use of the finalization mechanism to free resources before an object is garbage collected.

  • Distinguish between static and instance initializer expressions and initializer blocks, and how they are used for object initialization and class initialization.

  • State the phases involved in initializing the object state when an object is created using the new operator.

Get Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.