how exactly garbage collection take place?

Answer Posted / niraj talukdar

Garbage Collection is an automated process in Java unlike C
and C++. It executes to wipe out those objects which no
longer are used in a program or stay idle for a very long
time. This to free memory space alloted to these
objects.However, it is not guaranteed that all the idle
objects wil be destroyed every time garbage collection
process gets executed.A user can also manually call the
garbage collection to take place by executing System.gc()
method.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to print “hello” even before main is executed. How will you acheive that?

761


What is ordered map in java?

630


What do you understand by the term string pool?

646


What is purpose of applet programming?

748


Write a code to create a trigger to call a stored procedure

616






How do you create a sop?

624


How can we make sure main() is the last thread to finish in java program?

779


How do you execute a thread in java?

610


Can arraylist hold different types java?

574


What is anagram word?

623


Can you run java program without main method?

646


What are different types of classloaders?

675


What is java life cycle?

624


What are multiple inheritances?

685


Why heap memory is called heap?

670