aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Garbage Collection Question from Devaka's Exam Labs for SCJP6 - diagnostic exam question number 70. 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 "Garbage Collection Question from Devaka Watch "Garbage Collection Question from Devaka New topic
Author

Garbage Collection Question from Devaka's Exam Labs for SCJP6 - diagnostic exam question number 70.

Anbarasu Aladiyan
Ranch Hand

Joined: Jun 02, 2009
Posts: 182

Question: How many objects are eligible for garbage collection after executing statement “c.aob=null”


I thought only one object is eligible for garbage collections ( ie created at line 6).
But the correct answer is two objects are eligible for garbage collection. But how?

A.A.Anbarasu
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

This question has been asked in the past like here and here. Checkout the explanation in those topics...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Anbarasu Aladiyan
Ranch Hand

Joined: Jun 02, 2009
Posts: 182

Thanks Ankit
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3268
    
  52

anbarasu aladiyan wrote:Question from Devika's Exam Labs

Who is that?


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

Oh my god Devaka, you had a sex change operation??
Anbarasu Aladiyan
Ranch Hand

Joined: Jun 02, 2009
Posts: 182

Do not worry Devaka (I think i am correct at this time...) i changed it. And Ankit
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3268
    
  52

anbarasu aladiyan wrote:And Ankit

Cool down anbarasu, Ankit was joking here as usual .
And, having such a sex change operation is a violation of the JavaRanch naming policy
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

anbarasu aladiyan wrote:And Ankit

, that was just a joke mate, don't get pissed
Anbarasu Aladiyan
Ranch Hand

Joined: Jun 02, 2009
Posts: 182

@Ankit Garg ,
@Devaka Cooray
i was just kidding.
Shailesh Phatak
Ranch Hand

Joined: Aug 27, 2009
Posts: 64


See Dreams With Open Eyes And Make It Real
 
jQuery in Action, 2nd edition
 
subject: Garbage Collection Question from Devaka's Exam Labs for SCJP6 - diagnostic exam question number 70.