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
Why java is call by value?
What is the default value of the local variables?
What is the use of private static?
Can we sort arraylist in java?
Which java ide is used the most?
Is empty string in java?
How do you use find and replace?
How to read and write image from a file ?
what is mutual exclusion? How can you take care of mutual exclusion using java threads? : Java thread
What do you understand by the term wrapper classes?
What is high level language in computer?
Is java good for beginners?
Where and how can you use a private constructor?
What are static variables and functions?
What is private protected in java?