Infosys Interview Question

what is a garbage collector in Java