What exactly is a garbage collector? and How to use it? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What exactly is a garbage collector? and How to use it?

Someone explained to me once but I still don't understand :\

27th Feb 2018, 2:38 PM
luʁi
3 Answers
+ 8
We don't use garbage collector explicitly. It's an automated process to free up unused resource in the application and you can think of it like a maid in the program. 😉 Most of the time we don't really need to care about it unless writng in unmanaged code.
27th Feb 2018, 3:02 PM
Zephyr Koo
Zephyr Koo - avatar
+ 4
27th Feb 2018, 2:55 PM
cHiRaG GhOsH
cHiRaG GhOsH - avatar
+ 3
It is a way to destroy the unused objects. Java make that automatically
27th Feb 2018, 3:02 PM
Dick Solomon