Pregunta de entrevista de Redgate Software

How garbage collection works in Java?