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
How to optimize the javac output?
What are access specifiers in java ?
What is the difference amongst jvm spec, jvm implementation, jvm runtime ?
What is a qms manual?
Can we inherit a class with private constructor?
What does split function do in java?
What are some examples of variable costs?
Java Compiler is stored in JDK, JRE or JVM?
Is singleton set an interval?
What does string [] args mean?
Explain about abstract classes in java?
Which object oriented concept is achieved by using overloading and overriding?
If an application has multiple classes in it, is it okay to have a main method in more than one class?
What is the purpose of final keyword and when to use it?
Difference between comparator and comparable in java?