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
Is an empty arraylist null?
What is a buffer in computer?
When do you call copy constructor?
Is void a data type?
How is treeset implemented in java?
Can list have duplicates in java?
Can two objects have same hashcode?
Explain when we should make an instance variable private.
How does thread synchronization occurs inside a monitor?
what is function overloading in java?
What is the difference between stored procedure & function?
What are the differences between string and stringbuffer?
What is google full form?
Explain the difference between an Interface and an Abstract class?
What is percentage in java?