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
What are generic methods?
What are structs in java?
Can java program run without jre?
which class is the wait() method defined in? : Java thread
Explain the features of interfaces in java?
Why does abstract class have constructor?
What is balanced tree in java?
Which package has light weight components in java programming?
how to run ecllipse with jettyserver for windows environment using batch file
What is the main function in java?
What things should be kept in mind while creating your own exceptions in java?
Explain different types of wrapper classes in java?
How many bytes is a string in java?
What is the significance of java packages?
Difference between arraylist and vector.