---
title: "How is final different from finally and finalize()?"  
description: "How is final different from finally and finalize()?"  
author: "Sara Khan"  
published: 2017-12-21  
canonical: https://answers.mindstick.com/qa/31891/how-is-final-different-from-finally-and-finalize  
category: "technology"  
tags: ["java programming"]  
reading_time: 1 minute  

---

# How is final different from finally and finalize()?

How is final different from [finally and finalize](https://www.mindstick.com/interview/33848/what-are-finally-and-finalize-in-java)()?

## Answers

### Answer by Hemant Patel

Hi Sara,

Now we go to a short description of **Final**, **Finally** and **[Finalize](https://www.mindstick.com/forum/101/what-is-the-difference-between-finalize-and-dispose)(),**

In Java, **final** is a modifier which can be applied to a class or a method or variable. *It can't be inherited and overridden and also when we declare a variable by using the final word*, **it's valued can't be changed**.

**finally** is executed whether an exception is raised or not by the try block code segment. Or in other words ***finally is an exception handling block which gets executed whether an exception is raised or not by the try block code segment.***

And the last one is, **finalize()**, it's a **method of object class which will be executed by the JVM just before garbage collecting object to give a final chance for resource releasing activity.**

## *Hope it's informative for you...*


---

Original Source: https://answers.mindstick.com/qa/31891/how-is-final-different-from-finally-and-finalize

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
