Pregunta de entrevista de Oracle

How is garbage collection achieved in Java.