Pergunta de entrevista da empresa Morgan Stanley

How does the garbage collection work in Java? Can you explain one of the methods the GC uses?