I encountered this question in an interview with following options:
How to destroy an object in java?
e. Java performs gc by itself, no need to do it manually.
Answer E is correct answer. If E is not there, you will soon run out of memory (or) No correct answer.
Object should be unreachable to be eligible for GC. JVM will do multiple scans and moving objects from one generation to another generation to determine the eligibility of GC and frees the memory when the objects are not reachable.