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
What is the purpose of using bufferedinputstream and bufferedoutputstream classes?
What if constructor is protected in java?
What is a variable simple definition?
In which language java is written?
how do I create a runnable with inheritance? : Java thread
What is default exception handling in java?
What are the features of java?
Is java an ide?
What is static block?
Can we extend a class with private constructor?
What is singleton class in java and how can we make a class singleton?
Does the order of public and static declaration matter in main method?
How much is a java license?
What is string variable?
Explain the difference between intermediate and terminal operations in java8?