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

Garbage collection question

Veena Pointi
Ranch Hand

Joined: Jun 20, 2002
Posts: 442

When the processing of line 2 begins how many objects of type J that were created at line 1 are eligible for garbage collection?
Ans is 3
Isn't it 4?Coz j will reffer to 0,1,2,3,4 values of i.Last object it reffers is new J(this,4) which is not eligible for garbage collection on line2.So On line 2 objects which are eligible for garbage collection are
new J(this,0)
new J(this,1)
new J(this,2)
new J(this,3)
That makes them 4.Am I right?


SCJP1.4
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
Veena: I agree with you.
Veena Pointi
Ranch Hand

Joined: Jun 20, 2002
Posts: 442
So answer given in the exam is wrong?Can I get few more votes?
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Veena,
I recognize that question as one of mine, but it does not appear in the most recent version of my exam. Currently, I have it in a source file named optional.xml, but I didn't include any of the optional questions in the new version. The answer that I have in the file now is 4, not 3. Where did you find that question?


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Veena Pointi
Ranch Hand

Joined: Jun 20, 2002
Posts: 442
Dan,
I found it here
Giri Mandalika's mock exam
Sudhakar Krishnamurthy
Ranch Hand

Joined: Jun 02, 2003
Posts: 76
Why isn't the last object created J(this,4) not a eligible for GC, at line 2 no other object holds reference to the last object...what am i missing here??
TIA
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Sudhakar,
The reference variable j is still in scope at line 2.
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Veena,
I can't get into that web site, because the daily bandwidth has been exceeded.
My questions are copyright protected. Does that person identify that question as something that has been copied from my web site or is this a blatant case of plagiarism?
Could you provide a more specific link to the page where the question appears?
Thank you!
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
Originally posted by Dan Chisholm:
Could you provide a more specific link to the page where the question appears?
Thank you!

Here (look for question #21)
Go to the site Veena has mentioned and then click on the link 1-50 under Show Questions heading.
As for as I noticed, there is no mentioning of your name there
[ October 03, 2003: Message edited by: Mani Ram ]

Mani
Quaerendo Invenietis
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Mani,
Thank you for that information. That is an obvious case of plagiarism. Does anyone have an email address for Giri? I looked for one at that web site, but I didn't see one. Does that person post here at the Ranch?
Alton Hernandez
Ranch Hand

Joined: May 30, 2003
Posts: 443
Hi Dan,
I'm not sure if this would help but Giri's site is actually listed
here at JavaRanch.
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
Hi Dan,
I have sent you a personal message. Please check.
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Originally posted by Mani Ram:
Hi Dan,
I have sent you a personal message. Please check.

share it with us!, we want to know what happened with the copyright problem.. he/she should be penalized, Dan's site rocks!!!
BTW
"to steal ideas from other is plagiarism, to steal from many is research"
hmmm
[ October 03, 2003: Message edited by: Andres Gonzalez ]

I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Alton,
Thank you. I did notice that earlier. I'm sure the ranch didn't know that the site contains plagiarized material. I hope that the link will be removed, but I don't know if it will.
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Thank you for the support Andres.
Actually, Mani doesn't have the email address.
Alton Hernandez
Ranch Hand

Joined: May 30, 2003
Posts: 443
Did a little bit of research (not that research in Andres' quote ).
I discovered this site which I believe Giri maintained. It looks like he/she is somewhere in Dallas.
Thomas De Vos
stable boy
Ranch Hand

Joined: Apr 12, 2003
Posts: 425
I also found out that he/she "borrowed" some of the questions from javacertificate.com without permission. Since Giri *did* credit the source of the question I didn't bother persuing it any further.
Thomas De Vos
[ October 05, 2003: Message edited by: Thomas De Vos ]

Try your free <a href="http://www.javacertificate.com" target="_blank" rel="nofollow">SCJP 1.4</a> certification centre.<br />Try your free <a href="http://www.j2eecertificate.com" target="_blank" rel="nofollow">SCWCD</a> certification centre.<br />Try your free <a href="http://www.ejbcertificate.com" target="_blank" rel="nofollow">SCBCD</a> certification centre.<br />Try your <a href="http://www.webspherecertificate.com" target="_blank" rel="nofollow">Websphere (Test 285) </a> certification centre.<br />Try your <a href="http://www.j2mecertificate.com" target="_blank" rel="nofollow">SCMAD</a> certification centre. (New)<br /> <br /><a href="http://blogs.javacertificate.com" target="_blank" rel="nofollow">Java/J2EE Certification Blogging</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Garbage collection question
 
Similar Threads
garbage collection
Unexpected GC Behavior
Kathy, Dan, Shishio, Valentine, get on the subject: Final Word on GC
garbagecollection
Dan exam doubt 19