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

Answer Posted / pranab dutta

When a Java object becomes unreachable to the program, then
it is subjected to garbage collection. The main use of
garbage collection is to identify and discard objects that
are no longer needed by a program so that their resources
can be reclaimed and reused.

Is This Answer Correct ?    324 Yes 35 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are unchecked exceptions in java?

705


How is it possible for two string objects with identical values not to be equal under the == operator?

616


Explain how hashmap works?

676


What is the meaning of immutable regarding string?

614


What are the types of collections in java?

624






What checkbox method allows you to tell if a checkbox is checked?

641


What is the difference between stored procedure & function?

640


What is method reference?

612


What is the difference between normal report & matrix report?

651


What is qualitative variable?

602


How to do encapsulation in java?

674


Give an example of call be reference significance.

696


Can subclass overriding method declare an exception if parent class method doesn't throw an exception?

618


What does snprintf return?

646


How do you remove spaces in java?

640