Java: Which statement about Garbage Collection is the strongest interview answer?

Difficulty:

Easy

Questions:

1

Time Limit:

2 minutes

Passing Score:

100%

Question

Which statement about Garbage Collection is the strongest interview answer?

  1. Garbage collection reclaims memory from objects that are no longer reachable.
  2. Garbage Collection is mostly a naming style choice and has little effect on runtime or design.
  3. Garbage Collection exists mainly to reduce the number of Java files in a project.
  4. 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