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

Answer Posted / ms

garbage collecton in java means, if a particular object in
a program is not being refered since long time then it will
be automatically deleted with the help of garbage collector
so that some amount of memory is saved.we can explicitily
call it by adding a method system.gc()in the program.so in
this case there is no need to use'destructor'to destroy the
objects.

Is This Answer Correct ?    69 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a method in java?

548


Is null a string or object in java?

538


Is zero a positive integer?

522


What methods are used to get and set the text label displayed by a button object?

548


What is the difference between static and non-static variables in java programming?

511






Explain java thread life cycle.

576


How to access arraylist elements in java?

484


What is the difference between size and length in java?

502


Why does my function print none?

511


Is there a jre for java 11?

547


Why is stringbuffer not immutable?

556


Why java is considered as platform independent?

581


How do you delete a list in java?

522


What is the difference between the ">>" and " >>>" operators in java?

499


What is r * in math?

540