dcsimg
Hi
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Teena_Pathak
Posted On:   Thursday, September 13, 2007 09:44 AM

import java.util.*; 2. public class Test { 3. // calcCache will reference a large HashMap that is 4. // only needed for the duration of doComputation(). 5. private Map calcCache = null; 6. public void doWork() { 7. init(); 8. doComputation(); 9. // Insert code fragment here 10. } 11. private void init() { // initialize calcCache code here ... 12. } 13. private void doComputation() { // computation code here ... 14. } 15.} What code fragment is added to the sample code at Line 9 above to allow the memory held by the large HashMap to be reclaimed by the system garbage collector? Choice 1 System.getRuntime().d   More>>

import java.util.*;
2. public class Test {
3. // calcCache will reference a large HashMap that is
4. // only needed for the duration of doComputation().
5. private Map calcCache = null;
6. public void doWork() {
7. init();

8. doComputation();
9. // Insert code fragment here
10. }
11. private void init() { // initialize calcCache code here ...
12. }
13. private void doComputation() { // computation code here ...
14. }
15.}
What code fragment is added to the sample code at Line 9 above to allow the memory held by the large HashMap to be reclaimed by the system garbage collector?
Choice 1 System.getRuntime().dealloc(calcCache);
Choice 2 System.free(calcCache);
Choice 3 calcCache = null;
Choice 4 dealloc(calcCache);
Choice 5 free calcCache;

   <<Less

Re: Hi

Posted By:   WarnerJan_Veldhuis  
Posted On:   Friday, September 14, 2007 03:10 AM

Are you just dumping all your quiz questions in here??? Do you make *any* effort to understand them?? If the answers are respectively "yes" and "no", then please fuck off... I already did my SCJP, SCJD, the whole shabang. Don't need to do yours either.

Re: Hi

Posted By:   Robert_Lybarger  
Posted On:   Thursday, September 13, 2007 06:47 PM

Well I've already answered one earlier, and that one wasn't properly formatted either. So tell you what, pull up the Java API docs and see if the System class has either of the methods needed for 1 or 2. Then go over to the Java keywords index and see whether 'free' exists. Then come back and post what you learned there (bookmark those while you're at it) and I'll fill in the rest. But the next post had better be
properly formatted
if you want any more help.

Re: Hi

Posted By:   WarnerJan_Veldhuis  
Posted On:   Thursday, September 13, 2007 03:22 PM

Are we supposed to read this? Format and try again.
About | Sitemap | Contact