posted 17 years ago
Which of the following will ensure that garbage collection runs?
a) System.gc()
b) Runtime.gc()
c) System.RunTime().gc()
d) None of these options
Since there is no way to predict the behavior of scheduling of the GC, I chose d.
But the correct answer is a.
Why is that?