DEVFYI - Developer Resource - FYI

What is the difference between final, finally and finalize?

Java Interview Questions and Answers (part 1)


(Continued from previous question...)

150. What is the difference between final, finally and finalize?

Short answer:
final - declares constant
finally - relates with exception handling
finalize - helps in garbage collection
If asked to give details, explain:
final field, final method, final class
try/finally, try/catch/finally
protected void finalize() in Object class

(Continued on next question...)

Other Interview Questions