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

Answer Posted / jaffer

Actually garbage collector is a daemon thread. Normally
JVM’s heap stores all objects which is created by new
operator. So objects are occupying memory in heap. Some
objects are not used for long time. So garbage collector do
that work automatically.
Otherwise we call finalization method

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a static class in java?

557


What does singleton mean in java?

510


How many types of operators are there?

526


What is byte [] in java?

538


What is binary tree in java?

536






Is string serializable in java?

545


What is a parameter used for?

520


What is size () in java?

552


we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.

1573


What is the differences between heap and stack memory in java? Explain

537


Is string a data type in java?

592


What is member in java?

495


What is the use of default method in interface in java? Explain

552


Can we override a variable in java?

552


Explain different states of a thread in java?

591