Tuesday, 27 March 2018

Difference between final, finally and finalize()?

final :Final is a keyword.
Final is used to apply restrictions on class, method and variable. Final class can't be inherited, final method can't be overridden and final variable value can't be changed.

finally:Finally is a block.
Finally is used to place important code, it will be executed whether exception is handled or not.

finalize: Finalize is a method.
Finalize is used to perform clean up processing just before object is garbage collected.

2 comments:

Difference between final, finally and finalize()?

final :Final is a keyword. Final is used to apply restrictions on class, method and variable. Final class can't be inherited, final ...