Hi Sanjana,
It seems to me that the mock exam itself is flawed.
The object reference by th is not accessable any more and is garbage collected when the garbage collecter runs.
1. Like Nikhil said, a thread is dead does not mean it can not be accessed.
2. We never know beforehand exactly when an object is garbage collected. Different GC algorithm is used in different
Java Runtime implementation. This means that even when GC runs, we don't know whether particular object that is no longer accessible will be garbage collected. So, instead of 'such object will be garbage collected at such time', the right terminology will be 'such object
is eligible for garbage collection after such time'.
3. Also
Assume that th is an instance holding a thread object.
does not sound right to me, because th is not an instance, it is a
reference to an instance of a thread object.
I am adding 2 and 3 to build a case questioning the accuracy of the mock exam.
So, if the question is worded like the following
Assume that th is a reference to a thread object. th.start() causes the thread to start running and eventually complete its execution. The object reference by th is then eligible for garbage collection.
then the answer will be definitely false.