what are the differences between final,finally,finalize
methods?

Answer Posted / vibhor bhatnagar

Final :
final is a Modifier
final variable is a constant.
final method cann't be overrid.
final class cann't be subclassed.

Finally :
The finally clause is used to provide the capability to
execute code no matter whether or not an exception is
thrown or caught.

Finalize:
The purpose of finalization is to give an unreachable
object the opportunity to perform any cleanup processing
before the object is garbage collected. OR An object’s
finalize() method may only be invoked once by the garbage
collector.

Is This Answer Correct ?    15 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different http methods?

733


What is the indent key?

798


What is the use of coding?

735


What is qualitative variable?

738


Can java hashmap have duplicate keys?

713


when should you use stringbuilder class in a program?

742


Why we used break and continue statement in java?

800


What is jit compiler ?

778


How can we make string upper case or lower case?

786


What is Java Shutdown Hook?

838


What is the byte order of byte buffer?

779


What is the difference between preemptive scheduling and time slicing?

834


What is compareto?

743


Is sizeof a keyword in java programming?

819


What do you mean by aggregation?

825