I am new to Java and confused about the garbage collector in Java. What does it actually do and when does it comes into action. Please describe some of the properties of the
The garbage collector allows your computer to simulate a computer with infinite memory. The rest is just mechanism.
It does this by detecting when chunks of memory are no longer accessible from your code, and returning those chunks to the free store.
EDIT: Yes, the link is for C#, but C# and Java are identical in this regard.