It's not a secret anymore!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes kathy sierra question doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "kathy sierra question doubt" Watch "kathy sierra question doubt" New topic

kathy sierra question doubt

Jacob Sonia
Ranch Hand

Joined: Jun 28, 2009
Posts: 179

Please help me understand that how is just one object eligible for GC after //dostuff is reached
Rohan Kayan
Ranch Hand

Joined: Sep 17, 2004
Posts: 123
Only object pointed by a1 is eligible to GC.

a2.b1 -> b1
a2.b2 ->b2

SCWCD 1.4, SCJP 1.4
Ankit Garg

Joined: Aug 03, 2008
Posts: 9465

Jacob please SearchFirst. This question has been asked many times in the forum. Search for "alpha beta" in the forum, you'll get a lot of good explanations...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: kathy sierra question doubt
It's not a secret anymore!