Question
Which statement about Garbage Collection is the strongest interview answer?
- Garbage collection reclaims memory from objects that are no longer reachable.
- Garbage Collection is mostly a naming style choice and has little effect on runtime or design.
- Garbage Collection exists mainly to reduce the number of Java files in a project.
- Garbage Collection matters only for frontend frameworks, not for core Java applications.
Hint
Start with the core rule behind Garbage Collection.
Answer and rationale
Correct answer: A. Garbage collection reclaims memory from objects that are no longer reachable.
Garbage collection reclaims memory from objects that are no longer reachable. This is the base concept interviewers commonly test first.
Track: Java