Jake Monhan wrote:So had it not been for the constructor initializing the name with passed literals, then name would not have been referenced by the String pool and would have been GC eligible like the array. Is this the mechanics of it?
Junilu Lacar wrote:lastname is not an object, it is an object reference variable. As I tried to explain before, variables don't get GC'd. You have to understand the distinction between reference variables and the objects themselves. Only objects are eligible for GC