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

Questions on Garbage Collections

Nikhil Jain
Ranch Hand

Joined: May 15, 2005
Posts: 385
Hello Friends,

I find really confusing when I tried to solve questions like "How many objects are eligible at garbage collection". Can you please suggest me some trick

Secondly in question like

obj a=new Integer();
boj b=new Long();
a=null; ....1
a=b; ....2

Will the object a be eligible for gc at line 1?

thanks
shashank


SCJP 1.4, SCWCD 1.4, SCBCD 1.5
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580

"How many objects are eligible at garbage collection". Can you please suggest me some trick



Use picture representation



Will the object a be eligible for gc at line 1?


After line 1 Object is eligible for GC
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Questions on Garbage Collections