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
How do you classify Dialog Box?
What is a default constructor and also define copy contrucyor?
What is the difference between the file and randomaccessfile classes?
What about static nested classes in java?
what are different ways in which a thread can enter the waiting state? : Java thread
Can you explain the final method modifier?
Explain naming conventions for packages?
What is the base class in java from which all classes are derived?
Explain what access modifiers can be used for methods?
Will the compiler creates a default constructor if I have a parameterized constructor in the class?
What is a top level class in java?
Why static functions are used?
Is stringwriter thread safe?
If two threads have same priority which thread will be executed first ?
What is immutable class in java?