Pergunta de entrevista da empresa S&T

What is garbage collector? How does is “collect” heap memory? What is a finalizer thread?