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 java a pure object oriented language?
5 Coding best practices you learned in java?
What are the states of thread in java?
Give us the name of the list layoutmanagers in java?
Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?
What is == and === in javascript?
What is the method in java?
Does java runtime require a license?
What are abstract methods in java?
What is unicode in java?
What happens when a thrown exception is not handled?
What is the map interface in java programming?
Difference between class#getinstance() and new operator ?
What are the advantages of autoboxing?
What is java full form?