final finally finalize Java

final finally finalize Java

Summary: A Java beginner gets confused with "final finally finalize Java". Explained in simple terms. Go through.

final and finally are keywords of Java doing different jobs. No comparison between them because they work for different jobs. finalize() is a method.

1. final

Keyword final can be applied in three places – variables, methods and classes and in each place they it perform different jobs.

2. finally

Keyword finally is used in combination with try block in exception handling. The statements of finally block are guaranteed of execution.

3. finalize

finalize() method is from Object class. It is called by the JVM before an object is garbage collected.

10 thoughts on “final finally finalize Java”

  1. Hello,

    thank you for providing such a helpful knowledge for us.
    my query is related to finalize() method.when it will be call in program please explain it with an example and also one request please provide search option in our site to find any topic realated to java within site only

Leave a Comment

Your email address will not be published.