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 difference between equals() and?
What is the benefit of abstract class?
What do you mean by multithreaded program?
os is developed in c no java is more secured then c na why dont the os developed is developed using java
Why super is first line in java?
What is primitive data type in java?
How do I convert a string to an int in java?
What are the procedures?
What if I write static public void instead of public static void in java?
Can a java program have 2 main methods?
What is lambda programming?
What is a qms manual?
Write a java program to count the number of words present in a string?
How to sort list of list in java?
What is a parameter in simple terms?