Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Questions on Garbage Collections  RSS feed

 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

"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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!