adspace


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

Answer Posted / devarathnam c,kotagudibanda(po

Hi...
GarbageCollector: Whenever an object is no longer used in
the program at that time the garbage collector reclaims the
memory of an object.It is controlled by the JVM ,The JVM
runs periadically by using "mark" and "sweep"algorithms.
Instead of "destructor" in c++ , java supports garbage
collector.

Is This Answer Correct ?    84 Yes 21 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between equals() and == in java?

1050


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

1089


What is java string pool?

1091


How to sort array in descending order in java?

1005


Write a program to find the whether a number is an Armstrong number or not?

1110


What are the differences between heap and stack memory in java?

1153


Is minecraft 1.15 out?

1056


What do you mean by an interface in java?

1110


What is a classloader in java?

1101


What is the difference between break and continue statements?

1135


Differentiate between static and non-static methods in java.

1135


explain different ways of using thread? : Java thread

1092


Write a program to print count of empty strings in java 8?

1095


What is an object in java and how is it created?

1154


What is a constructor overloading in java?

1136