LearnFrenzy
Sign in Take a free test

Classes and Objects · Classes and Objects MCQ · Question 14

Does System.gc() free memory immediately? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 14 Back to Exercise

What does System.gc() guarantee?

  • A Immediate collection of all garbage
  • B Nothing – it only suggests that the JVM run the garbage collector Correct
  • C That finalizers run
  • D That the program pauses
Correct Answer: Option B

Production code should never depend on it.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links