Multiple choice technology programming languages

The developer can force garbage collection by calling System.gc().

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Calling System.gc() only suggests to the JVM that garbage collection should run, but it does not force or guarantee immediate garbage collection. The JVM decides when to actually perform GC based on its own algorithms and memory pressure.