Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

doubt in garbage collection question  RSS feed

 
Amrita Chaurasia
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
class C
{
public static void main(String a[])
{
C c1=new C();
C c2=m1(c1);
C c3=new C();
c2=c3; //6
anothermethod();
}
static C m1(C ob1){
ob1 =new C();
return ob1;
}
}
After line 6, how many objects are eligible for garbage collection?


I got this question from examsguide.com free sample questions...
please help
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!