posted 22 years ago
Hi all,
This question is from sum mock exam
Which statement is true?
A The NewGarb class will not compile.
B The getIt() method must not be declared as static.
C The NewGarb class compiles, but an exception is received because dg is not set to null.
D The rg object is eligible for garbage collection after a call to the getIt()
method has returned.
//I correctly marked the answered as d.
But what confuses me is...since the rg is returned it will have a link to the object after the call to getIt().
can some one help me how the rg is Garbage collected
-thanks in advance..