ContactUs :

Please send your Questions & Answers or Feedback to "mohan@javabook.org"

What is finally and finalize in java?

finally block is used with try-catch to put the code that you want to get executed always, even if any exception is thrown by the try-catch block. finally block is mostly used to release resources created in the try block.

finalize() is a special method in Object class that we can override in our classes. This method get’s called by garbage collector when the object is getting garbage collected. This method is usually overridden to release system resources when object is garbage collected.
Related Posts Plugin for WordPress, Blogger...
Flag Counter