How is Garbage collection done in Java?

Answer Posted / boomiraj

Programmer can not cause the garbage collector.
We can call the garbage collection using System.gc();
And we can set the variable value equal to null, it assign that variable garbage rest the that use.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you sort in java?

579


What are the main uses of the super keyword?

547


What is the difference between declaration and definition in java?

510


How do you declare a destructor in java?

496


Why do we need data structure in java?

562






What occurs when an object is constructed?

558


What does %d do in java?

572


What is the use of keywords in java?

545


Tell me about your ability to work under pressure

1763


What is set string?

586


Which is bigger double or float?

519


Explain wait() method of object class ?

624


What is serialversionuid?

553


Can constructor be protected in java?

497


What is not thread safe?

483