- Garbage collection is a process which is entirely in the control of the JVM. The user can only suggest the JVM to carry out the garbage collection.
- finalize method has the following prototype
→ protected void finalize()throws throwable
- finalize method of the given object will called by the JVM only once before garbage collecting the given object. If the object is resurrected inside the finalize method then that object will not be garbage collected. But when the object becomes eligible to garbage collection later the finalize method of the object will not be called again.
- if the finalize method throws any exception then JVM shall ignore it.
- Garbage collection in java is vendor implemented.