Explain final, finalize() and finally?

Answer Posted / radhika

Final keyword can be used for class, method and variables.
Afinal method can't be overriden.
Finalize() is used just before an object is destroyed or
garbage collected.
Finally keyword used in Exception handling, creates a block
of code that will be exceuted after a try and catch block.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How we can skip finally block of exception even if some exception occurs in the exception block in java?

526


Name few java util classes introduced with java 8 ?

507


Can we define constructor in inner class?

544


What is lambda expression in java?

543


Write a program to check string is palindrome without using loop?

568






Why static functions are used?

572


What is the original name of java?

544


What is the structure of java?

508


How do you delete a list in java?

534


Explain the difference between transient and volatile in java?

580


What is return keyword in java?

566


What is string english?

545


What does snprintf return?

551


Why are the destructors for base class and derived class called in reverse order when the program exits

1710


Which methods cannot be overridden in java?

539