DEVFYI - Developer Resource - FYI

When and How is an object considered as Garbage by a GC?

Java Interview Questions and Answers (part 3)


(Continued from previous question...)

427. When and How is an object considered as Garbage by a GC?

An object is considered garbage when it can no longer be reached from any pointer in the running program. The most straightforward garbage collection algorithms simply iterate over every reachable object. Any objects left over are then considered garbage.

(Continued on next question...)

Other Interview Questions