+1 vote
in JAVA by
What is the difference between final, finally and finalize?

1 Answer

0 votes
by

Below are the differences between Final Finally, and Finalize 

Final : 

1) Final is used to apply restrictions on class, method, and variable. The final class can't be inherited, final method can't be overridden, and final variable value can't be changed.

2) Final is a keyword.

Finally: 

1) Finally is a block.

2) Finally is used to place important code, it will be executed whether an exception is handled or not.

Finalize: 

1) Finalize is a method.

2) Finalize is used to perform clean up processing just before an object is garbage collected.

Related questions

0 votes
asked Nov 14, 2020 in JAVA by rajeshsharma
0 votes
asked Jul 1, 2023 in JAVA by sharadyadav1986
...