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

How does a cookie work in Servlets?

343


What is the differences between c++ and java? Explain

584


What exactly is a .class file?

573


What are the advantages of functions?

517


What is variable and its types?

539






Is minecraft 1.15 out?

545


Explain constructors and types of constructors in java.

642


Why is it called a string?

561


Where and how can you use a private constructor?

532


If two threads have same priority which thread will be executed first ?

842


What are benefits of java?

552


What is floating data type?

537


Can we define constructor in inner class?

535


Explain restrictions on using enum?

626


What is main in java?

506