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 multi-catch block in java?
Can a java program have 2 main methods?
Which sorting algorithm is best in java?
What is continuity of a function?
how to deploy apache tomcat server to weblogic server in java
List down the methods and interfaces of collection class in java.
What are the steps involved to write rmi based programs?
Why java does not support pointers?
How many types of interfaces are there?
Can we convert integer to string in java?
What are sets in java?
What is difference between iterator and enumeration in java?
What is illegal identifier in java?
How does a for loop work?
State the merge-sort principle and its time complexity.