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 is a loop java?
What is byte data type?
What differences exist between iterator and listiterator?
What should I import for arraylist in java?
What is a "pure virtual" member function?
What is variable argument in java?
What is an interoperable application in java ?
When is the finalize() called? What is the purpose of finalization?
What is nullpointerexception?
How do you remove duplicates from an array in java?
What is assembly condition codes?
Write a program to reverse array in place?
What is passing parameters in java?
What is meant by structural programming?
Can we make a constructor final?