final, finally, finalize what is the difference? (undone)

Final
Final used to declare properties, methods, and classes, attributes represent the same, and the method can not cover type can not be inherited.
The final attribute: The final modified variables can not be changed. A reference is immutable, the second is immutable objects.
The modified final reference address can not be changed, but you can make changes to this reference, may appen something into it. So the modified final must be initialized.

final: Method not when the method declaration is final, this method can not be any subclasses override this method, but subclasses can still use this method.

final parameter: This parameter indicates not be modified in the interior of this method.

final class: When a class is declared as final, these can not be inherited, so the method can not be overridden. A class can not be both abstract and is final.

finally
, as part of exception processing, for he can try / catch statement, and is provided with a block of statements, it indicates that the statement must be executed.

the Finalize
the Finalize method Object is a class when the garbage collector will call the object is to perform the recovery of the finalize () method, you can override this method to achieve the recovery of other resources.

Guess you like

Origin www.cnblogs.com/mjtabu/p/12090177.html