Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes doubt in garbage collection question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

doubt in garbage collection question

Amrita Chaurasia
Greenhorn

Joined: Jul 04, 2009
Posts: 7
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

Joined: Sep 28, 2004
Posts: 18546
    
  40

Duplicate question... please continue discussion at ....

http://www.coderanch.com/t/452512/Programmer-Certification-SCJP/certification/help-garbage-collection

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt in garbage collection question
 
Similar Threads
help in garbage collection question
Doubt - Reg: GC
garbage collection question
doubt on garbage collection
Garbage Collection