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 a line break example?
What is are packages?
What is the console in java?
Explain runtime exceptions?
how to deploy tomcatserver to weblogic server? write d following steps?
What is set string?
What is float in java?
How to check if linked list contains loop in java?
What is string manipulation?
How hashset works internally in java?
What is anti pattern in java?
Are arrays immutable in java?
What is compareto?
Differentiate between overriding and overloading cases?
What access modifiers can be used for class ?