File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Mock Exam Errata and the fly likes Boone's Exam #65 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Mock Exam Errata
Reply Bookmark "Boone Watch "Boone New topic
Author

Boone's Exam #65

bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
This was taken from Boone's mock exam at:
http://www.geocities.com/SiliconValley/Orchard/9362/java/javacert/newboone40-70.html
Question #65
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.
He gives the answer as b,c,e
B is wrong though because while you can request the GC to run, you can not enforce it to run whenever you want to.
C I am not sure about, can anyone help me with that one.
E I know is true.
Thanks,
Bill
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi Bill,
Think you're right about b; if it read "You can directly invoke the gc.." then it would be true. Using 'run' is, IMHO, misleading.
As to c, according to Jamie Jaworski in Java 2 Certification one of the gc's activities is:
<quote>
Informing selected objects that they are no longer in use and that they should release any nonmemory resources.
</quote>
I think the informing bit has to do with the gc calling <code>finalize()</code> before destroying the object; since the Java Programming Language by Gosling and Arnold says the <code>finalize</code> method should be used to clean-up any non-memory items.
Hope that helps.
------------------
Jane
The cure for boredom is curiosity.
There is no cure for curiosity.
-- Dorothy Parker


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
 
 
subject: Boone's Exam #65
 
Threads others viewed
Barry Boone's Mock Exam
From Boone's Exam Again
Boone's qns
Boone's question
Boone's Question on Threads
MyEclipse, The Clear Choice