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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.