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 the difference between quicksort & mergesort? When should they be used? What is their running time?

839


What is an infinite loop in java? Explain with an example.

787


Can we extend private class in java?

769


How is a structure different from array ?

787


What is the format specifier?

710


what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread

775


Define packages in java?

786


What is broken and continue statement?

742


Which is faster string or stringbuilder?

709


What is a wrapper method?

761


What do you mean by jjs in java8?

762


What is nested loop? What is dangling else condition in it?

813


What is meant by class?

767


Is null or empty java?

757


If a class is declared without any access modifiers, where may the class be accessed in java programming?

895