Sorry, i'm wondering about, is there any
Java function that could be executed to check how many objects in JVM?..
Perhaps, if there's, it's easier to know the correct answer..
Yes, i think the answer to the code is
C, because in the second
new Eligible();, refer to null reference..
Although in the code there's looping and it would execute new Eligible(); 10 times, but only 5 objects has the same reference, (so only one object would be created from this looping), and the 5 other objects has no reference..
these 10 objects is eligible for GC..