I disagree. It is not necessarily scheduled, and you are given no guarantees whatsoever that it will actually run before termination of the program. The only garbage collection guarantee the Java language gives you is that the garbage collector will run before an OutOfMemoryError is thrown.
Originally posted by Charles Leung:
After careful reading, I think option B is correct. When you called System.gc(), you know it will run in future. Although the exact time is unknown, you may say it is "scheduled".
You can directly run the garbage collector whenever you want to
it will be schedule in due time
(c)The garbage collector informs your object when it is about to be garbage collected.
Originally posted by Lih Wang:
Can someone explain what does (c) exactly mean? Thanks.