Possible Duplicate:
What is the garbage collector in Java?
Within my program, I have a function set up that calls another function after a certain amount of time (we'll set it as 20 minutes for purposes of this example) using ScheduledThreadPoolExecutor
.
The function that gets called, we'll say is removeStat(Character char)
. In the method, it makes references to functions in side character (we'll say char.getClient().getWriter()
). We'll assume that during the 20 minute wait period, the character in question logs out and their Character instance is no longer required.
Would the Java garbage collector remove the Character
class in that time, causing for the char in removeStat
to be null, or does it know to wait until the call has been made?