Can an object be garbage collected while it is still reachable
A reachable object cannot be garbage collected. Only unreachable objects may be garbage collected. No, an object cannot be garbage collected while it is still reachable. In Java, the garbage collector is responsible for reclaiming memory occupied by objects that are no longer reachable or referenced by any live part of the program. If an … Read more