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
Who developed java?
What is difference between equal and == in java?
What comes to mind when someone mentions a shallow copy in java?
Difference between Preemptive scheduling vs. Time slicing?
Describe the Big-O Notation.
What is static import in java?
What is java object name?
Program to Find the second largest element in an array.
What is difference between pointer and reference?
What is anagram number?
which pattern is default in scanner package?
What is meant by singleton class?
What is an infinite loop?
How to retrieve data from database in java using arraylist?
When is the finally clause of a try-catch-finally statement executed?