Multiple choice

Choose the correct statement(s) regarding garbage collection in Java.

  1. Garbage collection can be forced explicitly.

  2. Garbage collection is done by JVM.

  3. User can request JVM for Garbage collection explicitly calling gc() method.

  4. Both 1 and 2 are true.

  5. Both 2 and 3 are true.

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

Option 2 and 3 both are true. Hence this option is the correct answer.