Question: what is the difference between system gc and finalize?
Answer: system. gc() method notifies the JVM that the garbage collector can run now to clear the memory by deleting unused objects. ... finalize() method will not trigger garbage collector instead it will be called while the garbage collector about the destroy the object. It provides the instructions to clear the object properly.