What is garbage collection in Java, and how can it be used ?

Answer Posted / ms

garbage collecton in java means, if a particular object in
a program is not being refered since long time then it will
be automatically deleted with the help of garbage collector
so that some amount of memory is saved.we can explicitily
call it by adding a method system.gc()in the program.so in
this case there is no need to use'destructor'to destroy the
objects.

Is This Answer Correct ?    70 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What will happen if a thrown exception is not handled?

650


What classes of exceptions may be thrown by a throw statement?

631


How to perform linear search in java?

646


When should you use arraylist and when should you use linkedlist?

574


What happens when you add a double value to a string?

645






Difference between arraylist and vector.

693


What is comparable and comparator interface? List their differences

683


Explain jdk, jre and jvm?

657


What is null mean in java?

714


Why does abstract class have constructor?

657


What are the features in java?

691


What is the applet security manager, and what does it provide?

644


Explain the access modifiers for a class, method and variables?

757


What is garbage collection? What is the process that is responsible for doing that in java?

758


What is the public field modifier?

637