Object.finalize() is called by the garbage collector on an object when garbage collection determines that there are no more references to the object.