DEVFYI - Developer Resource - FYI

What is the purpose of garbage collection in Java, and when is it used?

Java Interview Questions and Answers (part 3)


(Continued from previous question...)

462. What is the purpose of garbage collection in Java, and when is it used?

The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.

(Continued on next question...)

Other Interview Questions