• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Q:65 on Barry Boone Exam

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 65: Which statements about garbage collection are true?
Select all valid answers.

a.You can directly free the memory allocated by an object.
b.You can directly run the garbage collector whenever you want to.
c.The garbage collector informs your object when it is about to be garbage collected.
d.The garbage collector reclaims an object�s memory as soon as it becomes a candidate for garbage collection.
e.The garbage collector runs in low-memory situations.
I selected option c & e as correct answer.but in the answer includes b also.How can we run GC , whenever we want...
IMO, we can just request to run not force.
can anybody explain me , what could be the right answer....
thanks in advance,
DS

 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only d should be correct answer
c is not correct because garbage collector cannot predict when
the object will not have any references to it.
b is incorrect because issuing command System.gc()
only suggests to start Garbage collector do not guarantees
e will be correct only if it were written as
"e.The garbage collector may run in low-memory situations."
I hope it clarifies your doubts
any other takers for it ?

Originally posted by Deepak Sachdeva:
Question 65: Which statements about garbage collection are true?
Select all valid answers.

a.You can directly free the memory allocated by an object.
b.You can directly run the garbage collector whenever you want to.
c.The garbage collector informs your object when it is about to be garbage collected.
d.The garbage collector reclaims an object�s memory as soon as it becomes a candidate for garbage collection.
e.The garbage collector runs in low-memory situations.
I selected option c & e as correct answer.but in the answer includes b also.How can we run GC , whenever we want...
IMO, we can just request to run not force.
can anybody explain me , what could be the right answer....
thanks in advance,
DS


 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Deepak,
Here is the forum link which already discussed the same question.
http://www.javaranch.com/ubb/Forum24/HTML/002457.html
Hope this will help you
Thanks
Nirmala
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nirmala,
can u pl. tell me what are the correct options for this question,
thanks,
DS

reply
    Bookmark Topic Watch Topic
  • New Topic