Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage collection question

 
Veena Pointi
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
Barkat Mardhani
Ranch Hand
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Veena: I agree with you.
 
Veena Pointi
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So answer given in the exam is wrong?Can I get few more votes?
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Veena Pointi
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan,
I found it here
Giri Mandalika's mock exam
 
Sudhakar Krishnamurthy
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudhakar,
The reference variable j is still in scope at line 2.
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 443
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dan,
I'm not sure if this would help but Giri's site is actually listed
here at JavaRanch.
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dan,
I have sent you a personal message. Please check.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the support Andres.
Actually, Mani doesn't have the email address.
 
Alton Hernandez
Ranch Hand
Posts: 443
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic