Redgate Software Interview Question

How garbage collection works in Java?