Pregunta de entrevista de Barclays

How does Java do garbage collection?