Infosys interview question

what is a garbage collector in Java