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

What is a java lambda expression?

545


What is the need of transient variables in Java ?

571


What are the advantages and disadvantages of reference counting in garbage collection?

562


What do you mean by stack?

627


Differentiate between postfix and prefix operators in java.

631






Discuss 2D arrays.

597


What are aggregate functions explain with examples?

515


What is the difference between math floor and math round?

489


Explain restrictions for using anonymous inner classes?

574


What is a java predicate?

526


What is finally in Java?

568


What is charat java?

535


I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?

563


Can an arraylist be empty?

556


How does sublist works in java?

532