In one of the SCJP prep mock exams I saw such a question:
1) code creates an object of a class with finalize method.
2) code calls the finalize method for that object..
3) something makes that object unused and eligible for garbage collection
now, when the GC runs, will it again run the finalize method for the same object..?
(unfortunately no answer or explanation was provided.....)
The JVM may or may not call the finalize method. If it does, it does it only once. It does this regardless of how many times you call the finalize method yourself. However, you should never call the method yourself.