All objects need not necessarily be garbage collected. The output will be different in different environment settings. In my system 4 objects were garbage collected. There is no guarentee that all unnecessary objects will be GCed.
So what to do when I get such questions asking for how many objects will be garbage collected considering the above code. I too know that the gc is totally under the control of JVM. Please can anyone give me ideason what to concentrate and on what not to for the scjp 1.4, Garbage collectors topic.
Regards, Jothi Shankar Kumar. S
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!