Amey Ambulgekar wrote:hello,
yes object aa gets garbage collected but life of all variable('s) or Object('s) is depends on "{}" <-- so may be all gets garbage collected..
Thanking you.
But the question refers to the context after aa = null; and before the closing brace of main.Only one object,initially referred by aa is eligible for GC here.