

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference Between Final, Finally and Finalize in Java
In this post, we will understand the difference between ‘Final’, ‘Finally’, and ‘Finalize’ in Java.
Final
It is a keyword.
It is used to apply restrictions on classes, methods and variables.
It can’t be inherited.
It can’t be overridden.
Final methods can’t be inherited by any class.
It is needed to initialize the final variable when it is being declared.
Its value, once declared, can’t be changed or re-initialized.
Finally
It is a block.
It is used to place important code in this block.
It gets executed irrespective of whether the exception is handled or not.
Finalize
It is a method.
It is used to perform clean up processing right before the object is collected by garbage collector.
- Related Questions & Answers
- final, finally and finalize in Java
- What is the difference between final, finally and finalize() in Java?
- final, finally and finalize in C#
- Difference Between dispose() and finalize() in C#
- Difference Between Static and Final in Java
- Difference between constants and final variables in Java?
- What is the difference between Finalize and Dispose in C#?
- PHP Interaction between finally and return
- Difference between Java and JavaScript.
- Difference between Go and Java.
- Difference Between C++ and Java
- Can we write any statements between try, catch and finally blocks in Java?
- How many times finalize method will be invoked? who invokes finalize() method in Java?
- Difference between Java and C language
- Difference between constructor and method in Java
Advertisements