| Author |
Garbage collection?
|
srikanth reddy
Ranch Hand
Joined: Jul 28, 2005
Posts: 252
|
|
here i thought the answer to be 2.. but its not ...can anyone explain me when does the object gets garbage collected exactly?? srikanth
|
Thanks & Regards<br /> <br />-Srikanth
|
 |
Srinivasa Raghavan
Ranch Hand
Joined: Sep 28, 2004
Posts: 1228
|
|
Never in that method . Answer 'c' because , eventhough 'b' is set to null the reference variable c points to this object and it is returned to the calling place. [ September 22, 2005: Message edited by: Srinivasa Raghavan ]
|
Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
|
 |
Lalitha Gottumukkula
Ranch Hand
Joined: May 24, 2005
Posts: 45
|
|
|
Because it is having direct reference (c), it is never garbage collected.
|
 |
srikanth reddy
Ranch Hand
Joined: Jul 28, 2005
Posts: 252
|
|
yes srinivas, got it ..thanks for your help
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Garbage collection?
|
|
|