The finalize method is never invoked more than once by a Java virtual machine for any given object. In for loop you are yourself invoking the finalize method programmatically and not the JVM automatically ( which is done when objects are GCed).
Moreover, the finalize method is not guaranteed to be called by the GC. The only guarantee is that if called once by JVM it won't be called again by JVM at the time of garbage collection. [ December 14, 2008: Message edited by: Harvinder Thakur ]
Joined: Oct 10, 2007
Thanks, Harvinder. I thought that finalize() can be invoked only once for an object(program or JVM).