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 the use of java?

526


Can private method static?

471


Explain the difference between abstract classes and interfaces in java?

596


What is java lang string?

544


What is use of static in java?

520






What is a heavyweight component?

542


What is return null in java?

507


Why is inheritance used in java?

602


What purpose do the keywords final, finally, and finalize fulfill?

610


Does string isempty check for null?

559


What is a line break example?

576


What is string subsequence method?

624


When do we use synchronized blocks and advantages of using synchronized blocks?

659


Give me example of derived data types.

587


What is sizeof () operator?

566