Garbage Collections

Q1: Which statement is true?

A All objects that are eligible for garbage collection will be garbage collected by the garbage collector.

B Objects with at least one reference will never be garbage collected.

C Objects from a class with the finalize() method overridden will never be garbage collected.

D Objects instantiated within anonymous inner classes are placed in the garbage collectible heap.

ANS:D - Objects instantiated within anonymous inner classes are placed in the garbage collectible heap.

All objects are placed in the garbage collectible heap. Option A is incorrect because the garbage collector makes no guarantees. Option B is incorrect because islands of isolated objects can exist. Option C is incorrect because finalize() has no such mystical powers.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.