Question: How many objects are eligible for garbage collection right before the end of the main() method? A. None. B. One. C. Two. D. Three. E.
How many objects are eligible for garbage collection right before the end of the main() method?

A. None.
B. One.
C. Two.
D. Three.
E. The code does not compile.
1: public class Person { 2: public Person youngest Child; 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: } } public static void main (String... args) { Person elena= new Person(); Person janeice = new Person(); elena.youngestChild = janeice; janeice = null; Person zoe new Person(); elena.youngestChild = zoe; zoe = null;
Step by Step Solution
3.34 Rating (148 Votes )
There are 3 Steps involved in it
The code provided is a Java snippet and the question pertains to identifying the number of objects t... View full answer
Get step-by-step solutions from verified subject matter experts
