Hi guys,
I would say only options
c and e are correct.
a) false You cannot directly free memory allocated by an object.
b) false There is no guarantee that the garbage collector will run when you call the <code>System.gc()</code> or <code>Runtime.gc()</code> method. The documentation for the <code>gc</code> method states:
"Calling this method suggests that the JVM expends effort towards recycling unused objects."
c) true The garbage collector calls <code>finalize</code> on an object. The SDK documentation on finalize states:
"Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. A subclass overrides the finalize method to dispose of system resources or to perform other cleanup."
d) false There is no guarantee that the garbage collector will reclaim the object memory as soon as it becomes garbage collectable.
e) true If you look at the OutOfMemoryError class description in the SDK documentation, it says:
"Thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector."
This means that the garbage collector will run in low-memory situations.
Cheers,
Beno�t
[This message has been edited by Beno�t d'Oncieu (edited November 01, 2000).]