Answer Posted / ranganathkini
Finalization is a facility provided by Java for classes who
use native resources to clean up before the objects are
garbage collected.
Since native resources or allocations are beyond the control
of Java's garbage collector, the responsibility of cleaning
up that native allocations falls on the object's
finalization code which shud ideally initiate quick clean up
operations and free any native memory it has allocated.
If finalization is not done, then the native resources wud
be left in the memory even after thier related Java
instances have been removed by the Java's GC. Hence it is an
invaluable feature.
But it needs to be used with caution as finalization
consumes more processing by Java
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
State differences between C and Java?
Mention the default values of all the elements of an array defined as an instance variable.
What are the five major types of reference sources?
What is Java Reflection API? Why it’s so important to have?
How many bits is a string in java?
How many characters is 16 bytes?
Explain about features of local inner class?
What is this keyword used for?
How will you invoke any external process in java?
why not override thread to make a runnable? : Java thread
Is there a way to increase the size of an array after its declaration?
Is assembly language a low level language?
How to instantiate static nested classes in java?
Explain the differences between static and dynamic variables?
What is meant by class loader? How many types are there? When will we use them?