Pregunta de entrevista de Publicis Sapient

How does Java garbage collector works?