Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Garbage collection question

 
pioneer
Posts: 469
  • 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?
 
pioneer
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Veena: I agree with you.
 
Veena Pointi
pioneer
Posts: 469
  • 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?
 
pioneer
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
pioneer
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan,
I found it here
Giri Mandalika's mock exam
 
pioneer
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
pioneer
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
pioneer
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!
 
pioneer
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
pioneer
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?
 
pioneer
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
pioneer
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dan,
I have sent you a personal message. Please check.
 
pioneer
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
pioneer
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
pioneer
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
pioneer
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.
 
stable boy
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 ]
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!