3 ms·
> Java even plans to remove them from the language The "Alternative techniques" section of the JEP suggests to use Cleaner.register, which was created as a rep
by bkail 3y ago
> Java even plans to remove them from the language
The "Alternative techniques" section of the JEP suggests to use Cleaner.register, which was created as a replacement and has a similar API to Go's runtime.SetFinalizer.
https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/ref/Cleaner.html https://docs.oracle.com/en/java/javase/20/docs/api/java.base...