Skip to content
Sharp

Garbage Collection · interview question

What happens to objects in the Young Generation during a Minor GC in Java?

Multiple choiceEasychapter-14-curatedpremiumgarbage-collectiongenerational-gc
Choose one answer
Answer and explanation

Correct answer

B. They are either collected if unreachable or promoted to the Old Generation if they survive.

Why

During a Minor GC, unreachable objects in the Young Generation are collected. Objects that survive a certain number of Minor GCs are promoted to the Old Generation.

Test yourself on Garbage Collection

A free test with instant, explained results. No account needed.

Start free test
All Garbage Collection questions →