LearnFrenzy
Sign in Take a free test

Classes and Objects · Classes and Objects MCQ · Question 13

When is an object eligible for garbage collection? Answer, explanation & discussion

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

When does an object become eligible for garbage collection?

  • A When its method finishes
  • B When no live reference can reach it any more Correct
  • C After one minute
  • D When System.gc() is called
Correct Answer: Option B

The JVM then decides when to actually reclaim 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