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 are three types of loops in java?
Is string is a keyword in java?
What do you mean by formatting?
Why enumeration is faster than iterator?
What is string example?
Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..
How does finally block differ from finalize() method?
How do you sort in java?
What is a dot notation?
How does a for loop work?
What is the inheritance?
Write a program to solve producer consumer problem in java?
How many bytes is a string?
Is simpledateformat safe to use in the multithreaded program?
What do you mean by local class?