Explain final, finalize() and finally?
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 ? | 4 Yes | 11 No |
Post New Answer View All Answers
What is the full name of java?
Why is singleton not thread safe?
How does regex work?
What is integer size in java?
how to deploy tomcatserver to weblogic server? write d following steps?
Can a class be final?
Which programming language is best in future?
What is the difference between hashmap and hashtable? What is an interface?
What is merge sort in java?
What is the ==?
What will happen to the exception object after exception handling?
What are some examples of variable costs?
Give few examples of final classes defined in Java API?
What is math floor in java?
What are different data structures in java?