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
Why do we use regex?
Is there any tag in htm to upload and download files?
What is java regex?
How do you achieve polymorphism in java?
Which class contains a method: cloneable or object?
What does snprintf return?
Why are global variables used?
What is string made of?
What is difference between printf and scanf?
Can an interface extend a class?
What are the advantages of packages in java?
Explain the reason behind ending a program with a system.exit(0)?
How can you make sure that your singleton class will always return single instance in multi-threaded environment?
What is reverse function?
what is thread? What are the high-level thread states? : Java thread