SQr Infotech Interview Question

How garbage collection works in java