Easy learning with example program codes

what is the difference between final finally and finalize in java?

final: final is a keyword in java which can be used with instance variables, local variables , methods and classes.

finally: finally block is mainly used to do clean-up task. It is always executed even when no exception occur. It will not execute only in case program exits using System.exit() or because of some fatal error cause program to abort. It is followed by either catch or try block.
Note: A try block can have one or more catch block associated with it, but only one finally block can be associates with it.

finalize: finalize is a method. Before an object is garbage collected, the runtime system calls its finalize() method. We can write system resources release code in finalize() method before getting garbage collected.

Java interview questions on exception handling

Sign Up/ Sign In
Ask a Question

Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at


We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on

Copyright © 2018 CodesJava Protection Status SiteMap Reference: Java Wiki