| Author |
finalize doubt
|
Chandra Bhatt
Ranch Hand
Joined: Feb 28, 2007
Posts: 1707
|
|
Given answers are a,c,d,e I suspect the behavior of finalize... How the things are happening here? Please help!!! Regards, cmbhatt
|
cmbhatt
|
 |
swarna dasa
Ranch Hand
Joined: Mar 15, 2007
Posts: 108
|
|
We really dont know if the GC does run, so Ans a) gets there. As is evident, the answer is not predictable after A1A2A3A1. The garbage collector could pick up the objects from the heap in any order. So there is no right answer, but acde are possible answers. Since GC is a daemon thread, it has a very small window when it can run, as the main method exits right after that statement.
|
 |
 |
|
|
subject: finalize doubt
|
|
|