Which Java feature automatically manages memory allocation and reclamation?
15 views
- Explicit malloc and free
- Garbage Collection (Correct Answer)
- Stack Allocation
- Static Memory Allocation
Explanation
Java’s garbage collector automatically frees memory occupied by objects that are no longer referenced, reducing memory leaks and manual memory management errors.