1. How can you force garbage collection? [a] Garbage collection cannot be forced [b] Call System.gc(). [c] Call Runtime.gc(). [d] Set all references to null. Answer 1 [a] Garbage collection cannot be forced i think garbage collection canbe forced by calling System.gc()or Runtime.gc(). m I wrong?
Joined: Aug 26, 2001
no it cannot be forced you can just tell the gc you would like it to run but nothing is guaranteed... Try to search the forum for "force garbage collection" you'll find some good discussion about the subject... HIH ------------------ Valentin Crettaz Sun Certified Programmer for Java 2 Platform