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
Can we create more than one object singleton class?
When arithmeticexception is thrown?
What does += mean coding?
What are the advantages of unicode?
What are the benefits of java?
Explain about anonymous inner classes ?
Where is the singleton class used?
how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? Or extending thread class or implementing runnable interface. Which is better? : Java thread
how we can make a read-only class in java?
How do you control extraneous variables?
Explain what access modifiers can be used for methods?
How do you make a thread in java?
How to solve the problem of generating the unique hash keys with hash function?
What is string builder?
What is byte data type?