Which one statement is true” a. All objects that are eligible for garbage collec
ID: 3714163 • Letter: W
Question
Which one statement is true”
a. All objects that are eligible for garbage collection will be removed from the heap by the garbage collector.
b. Objects with more than 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 method local inner classes are placed in the garbage collectible heap.
e. Once an overridden finalize() method is invoded, there is no way to make that object ineligible for garbage collection.
Explanation / Answer
A.) Yes (All eligible Objects will be removed by garbage collector because System.gc() runs as a demon thread and it can call any time by JVM)
B.) No (It can be garbage collected if it don’t have any links through program reference variables)
C.) No (It can be garbage collected by calling super.finalize() method)
D.) Yes (All types of objects will placed inside garbage collectible heap only)
E.) Yes (After finalize() method call we can make object eligible for garbage collection but we can't make ineligible.)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.