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.
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad: