How is Garbage collection done in Java?

Answer Posted / sandeep

Garbage Collection is a complex feature in Java Technology.
By Programme we cannot cause gc but we can request JVM using
gc() method but it does not gurantee. Actually when an
object in our programme become unreachable it is ready to
garbage collection..the garbage collection runs periodically
and then claim the memory it does occupy ( the unreachable
object)..and is how garbage collected is done.

Is This Answer Correct ?    17 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a locale?

689


Explain hashset and its features?

572


Explain public static void main(string args[]).

564


Can a constructor have different name than a class name in java?

590


What is not object oriented programming?

502






How to call one constructor from the other constructor ?

599


Why is stringbuffer not immutable?

559


Difference between keyword and identifier.

589


Is java a prime method?

550


What is multi-catch block in java?

613


What is byte value?

551


Explain heap sort?

698


Is treeset sorted in java?

577


What is java beans?

569


How can we make a class singleton?

570