How GC (Garbage Collector) knows the objects reference is
unused.Whether GC removes the unused object Parmanently or
it maintains something.

Answer Posted / devarathnam.c, kotagudibanda,k

Hi,
The Garbage Collector(GC)will be always under the control
of JVM, So JVM periodically runs the GC. It uses "sweep"
and "mark" algorithms to identify the unused objects in the
application. You don't bother about GC, JVM will take of it.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a class have multiple subclasses?

564


When is the garbage collection used in Java?

635


What is private static class in java?

482


How do you compare objects in java?

472


What is the difference between exception and error in java?

473






Explain java thread life cycle.

561


What is the main use of java?

553


What are different types of constants?

498


What is java argument list?

496


Define inheritance?

529


What are the 7 types of characters?

541


What is meant by stack and queue?

576


What is meant by flickering?

629


What is collection api?

590


What is an argument java?

507