What is garbage collection in Java?
Garbage collection is when Java deletes objects to free up space in memory, typically when memory is full.
You're close! However, garbage collection isn't always triggered by memory being full. Itâ€™s about objects becoming unreachable.
Can you elaborate on what makes an object 'unreachable' and how that triggers garbage collection?