Most Important Interview Question Of Java.

Most Important Interview Question Of Java

Difference between Final, Finally, and Finalize !!


1. Final

a. 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.

b. Final is a keyword.

2.Finally 

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

b. Finally is a block.

3. Finalize

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

b. Finalize is a method. 

Comments

Post a Comment