How does finalize() work in java?
问题 So, I recently discovered the finalize method in Java (not sure why I missed it before, but there it is). This seems like it could be the answer to a lot of the issues I'm working with, but I wanted to get a bit more information first. Online, I found this diagram illustrating the process of garbage collection and finalize: A couple of questions: This takes place in a separate thread, correct? What happens if I instantiate a new object during finalize? Is that allowed? What happens if I call