This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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?
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