Home > DeveloperSection > Interviews > What is difference between final, finally and finalize?

Posted on    April-29-2015 12:03 AM

 Java Java 
 1 Answer(s)
  540  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Posted on    April-29-2015 12:03 AM

final: final is a keyword, final can be variable, method or class.You, can't change the value of final variable, can't override final method, can't inherit final class.
finally: finally block is used in exception handling. finally block is always executed.
finalize():finalize() method is used in garbage collection.finalize() method is invoked just before the object is garbage collected.The finalize() method can be used to perform any cleanup processing.

Don't want to miss updates? Please click the below button!

Follow MindStick