Ques 171. Can an object's finalize() method be invoked while it is reachable?
An object's finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object's finalize() method may be invoked by other objects.
Is it helpful?
Add CommentView Comments
Ques 172. What is the purpose of garbage collection?
The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources may be reclaimed and reused.
Is it helpful?
Add CommentView Comments
Ques 173. What is garbage collection? What is the process that is responsible for doing that in java?
Reclaiming the unused memory by the invalid objects. Garbage collector is responsible for this process
Is it helpful?
Add CommentView Comments
Ques 174. What kind of thread is the Garbage collector thread?
It is a daemon thread.
Is it helpful?
Add CommentView Comments
Ques 175. What is the finalize method do?
Before the invalid objects get garbage collected, the JVM give the user a chance to clean up some resources before it got garbage collected.