In Java,garbage collectionis a mechanism that provides automatic memory management. It is done by the JVM. It need not to handle object allocation and deallocation by the programmer. In the previous sections, we have also discussed how garbage collection works. If you are not introduced to garb...