aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes GC 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 "GC" Watch "GC" New topic
Author

GC

Thiru Thangavelu
Ranch Hand

Joined: Aug 29, 2001
Posts: 219
I thought the answer is after //4. But the answer given is never GC. why?
After which line will the object created at line XXX be eligible for garbage collection?


Thanks,<br />Thiru<br />[SCJP,SCWCD,SCBCD]
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Because the object pointed by b is also pointed by c, and c is returned.


SCJP2. Please Indent your code using UBB Code
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
getObject() is returning a reference to the object you created at line XXX. Since the object is still referenced, it is not yet eligible for garbage collection.
HTH
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GC
 
Similar Threads
GC
garbage collection
Garbage collection?
Unfair Question on JQ
GC ??