---
title: "What is finalize method ?"  
description: "What is finalize method ?"  
author: "Anonymous User"  
published: 2015-07-15  
updated: 2020-09-19  
canonical: https://www.mindstick.com/interview/2705/what-is-finalize-method  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# What is finalize method ?

The Object class has a special method named finalize() that is called by garbage collector to allow an object to do the necessary cleanup that needs to occur before the memory used by the object are reclaimed. The finalize() method can be overridden by any class that uses system resources (file , db connection) and needs to release those resources or to perform other cleanup as part of implicit destruction by the garbage collector.

## Answers

### Answer by Anonymous User

The Object class has a special method named finalize() that is called by garbage collector to allow an object to do the necessary cleanup that needs to occur before the memory used by the object are reclaimed. The finalize() method can be overridden by any class that uses system resources (file , db connection) and needs to release those resources or to perform other cleanup as part of implicit destruction by the garbage collector.


---

Original Source: https://www.mindstick.com/interview/2705/what-is-finalize-method

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
