This blog has enough posts on c# finalizers. See also AutoCloseable^Closeable #java
python finalizer is a special class method object.__del__(self), invoked when reference count drops to zero, and garbage-collected. As such, it’s not useful for resource management, which is better done with context manager, a popular python idiom and the best-known “protocol” in python.
— Java finalizer is an important QQ topic
https://stackoverflow.com/questions/2506488/when-is-the-finalize-method-called-in-java has some highly voted summaries.
The finalize() method can be at any time after it has become eligible for garbage collection, possibly never.
The finalize() method should only be written for cleanup of (usually non-Java) resources like closing files. [[effJava]] says avoid it.
- java finalize()
- java 7 try-with-resources