Wednesday, September 24, 2008

difference between final, finally and finalize - JAVA Interview Questions and Answers

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


Can you call one constructor from another if a class has multiple constructors?
Yes. Use this() syntax.



No comments:

Post a Comment

Thanks to given comments.......

My Blog List