Answer Posted / nidhi
finalize is the method called(if defined) by garbage
collector just before it calls any object for garbage
collection. You are never sure that when will it be called.
The main aim for defining this method is to release the
resources that the object is holding before the object
could be deleted from the memory. If this method is called
then the object is not deleted from the memory in that
particular run of garbage collection but is deleted in the
next run.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is meant by class loader? How many types are there? When will we use them?
explain autoboxing in java?
What are actual parameters?
What is set string?
Explain the scope or life time of class variables or static variables?
How can we achieve thread safety in java?
Can we sort array in java?
What is anagram word?
What is the size of arraylist in java?
What is internal iteration in java se 8?
How does queue work in java?
Write a code to create a trigger to call a stored procedure
How is hashcode calculated in java?
What is Classloader in Java?
What is final method in java?