---
title: "Explain final, finally, finalize"
author: "standalone"
date: "2010-11-03T21:53:05Z"
tags: []
categories: ["编程语言"]
slug: "explain-final-finally-finalize"
draft: false
lastmod: "2010-11-03T21:53:05Z"
id: 802183
url: "https://standalone.iteye.com/blog/802183"
---

final is a keyword for class, methods, variable. A final class is a class which cannot be subclassed. A final method cannot be overrided. A final variable is not changable after it's initialized.

 

finalize() method is used just before an object is destroyed and can be called just prior to garbage collection.

finally is a keywork used in exception handling. code in finally block will be executed no matter exception is thrown or not.