ITeye博客

Explain final, finally, finalize

standalone · 2010-11-03 21:53 · java · 编程语言 · Markdown

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.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。