Review Questions

8.1 Which statement is true?

Select the one correct answer.

  1. Objects can be explicitly destroyed using the keyword delete.

  2. An object will be garbage collected immediately after it becomes unreachable.

  3. If object obj1 is accessible from object obj2, and object obj2 is accessible from obj1, then obj1 and obj2 are not eligible for garbage collection.

  4. Once an object has become eligible for garbage collection, it will remain eligible until it is destroyed.

  5. If object obj1 can access object obj2 that is eligible for garbage collection, then obj1 is also eligible for garbage collection.

8.2 Identify the location in the following program where ...

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.