what are the differences between final,finally,finalize
methods?
Answer Posted / sunil
final variable is a constant.
final method cann't be overrid.
final class cann't be subclassed.
finally is a block usually used to release all the
resources utilized inside the try block such as to free
resources like stream objects, to close sockets .The code
in finally block is guaranteed of execution
irrespective of occurrence of exception catched/uncatched.
finalize() is never run more than once on any object.
finalize method is called by the garbage collector on an
object when the garbage collector determines that there are
no more references to the object.
| Is This Answer Correct ? | 30 Yes | 6 No |
Post New Answer View All Answers
What is constant in programming?
What is the difference between array list and vector in java?
What is procedure writing?
What is java object name?
What is unicode in java?
Tell me about different OOPS concepts.
What is one third plus one third as a fraction?
Is arraylist dynamic in java?
What is a final class ?
Explain the difference between extends thread vs implements runnable in java?
What is purpose of find feature?
What does bitwise or mean?
Is array primitive data type in java?
What is a function in java?
What is the difference between a choice and a list?