Pregunta de entrevista de EPAM Systems

How does garbage collection work in Java.