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

Can private class be inherited in java?

541


Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.

511


How many bytes is a char in java?

522


Explain the meaning of java applet.

595


What is difference between array and arraylist in java?

455






how to deploy apache tomcat server to weblogic server in java

1590


What are the advantages of defining packages in java?

502


What are three advantages of using functions?

529


What is a method signature java?

562


What is int argc char * argv?

562


What is this keyword used for?

678


What is thread count in java?

539


Define reflection.

570


What is queue in java?

552


How do you stop a thread in java?

583