Skip to content
Sharp

Garbage Collection · interview question

What triggers an object promotion from the Young Generation to the Old Generation?

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

Correct answer

B. Surviving multiple Minor GCs.

Why

In a generational GC, objects that survive several Minor GCs are promoted to the Old Generation, as they are likely to be long-lived.

Test yourself on Garbage Collection

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

Start free test
All Garbage Collection questions →