final, finally, finalize Ku别

Original please indicate the source: https://www.cnblogs.com/agilestyle/p/11444366.html

final

can be used to modify final classes, methods, variables, each with a different meaning, represents the final modified class can not inherit expansion, final variables can not be amended, and the final method is not overridden (override).

final is not immutable!

 

finally

finally it is a mechanism to ensure that the focus of Java code that must be executed. You can try-finally or try-catch-finally close a JDBC connection to similar, to ensure unlock lock operation.

 

finalize

finalize is a base class java.lang.Object method, which is designed to ensure complete recovery of specific target resource before being garbage collected. finalize the mechanism has now been deprecated in JDK 9 and began to be marked as deprecated.

 

Guess you like

Origin www.cnblogs.com/agilestyle/p/11444366.html