Question: what is the difference between finally block and finalize method?
Answer: Using a finally block allows you to run any cleanup-type statements that you just wish to execute, despite what happens within the protected code. The finalize() method is used just before object is destroyed and can be called just prior to object creation.