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? 

1: public class Person { 2: public Person youngest Child; 3: 4:

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

1 Expert Approved Answer
Step: 1 Unlock

The code provided is a Java snippet and the question pertains to identifying the number of objects t... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!