Given the following program:
import java.io.*; import java.util.*; public class GCTest { public static void main(String[] args) throws Exception {
Slightly off-topic, but finalize() should never be used to close() a file. The language does not guarantee that finalize() will ever get called. Always use a try ... finally construct to guarantee file closure, database cleanup, etc.