could somebody explain how java uses garbage collection to reclaim unused memory space?
From reading that I have done, I am not sure which way it goes about it:
my example:
TownBuilding = new Building("Town Hall"); //(a)
TownBuilding = new Building("Public Library"); //(b)
When b is coded, does java simply overwrite the contents or does it create a new Variable (b) and leave (a) for garbage collection?
Very confused...
