Hi,
Jdiscuss question of the day - April 3, 2005
Which of these statements are true?
Select 1 correct option.
a) Objects can explicitly be destroyed using the keyword delete.
b) An object will be garbage collected immediately after the last reference
to the object is removed.
c) If object obj1 is accessible from obj2 and obj2 is accessible from obj1,
then obj1 and obj2 are not eligible for garbage collection.
d) Once an object has become eligible for garbage collection, it will remain
eligible until it is destroyed.
e) An object can be finalized only once.
Answer c cannot be correct as the question does mention any active references which refer to obj1 and obj2. If there are any live references which refer to either obj1 or obj2, then both of them will not eligible for garbage collection.
Answer e is correct because finalize() method which every object inherits from java.lang.Object can only be executed only once.