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

Answer Posted / sivadasan

Garbage collection is a thread, that runs to reclaim the
memory by destroying objects which object is cannot be
referenced anymore.

Deleting Dynamically created objects from the memory.

Finalize method used to achieve garbage collection.

By using Runtime.gc() or System.gc() the object will be
garbage collected.

Is This Answer Correct ?    30 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is polymorphism java example?

502


Write a program in java to find the maximum and minimum value node from a circular linked list.

499


Explain where variables are created in memory?

561


Difference between java and javascript

558


In Java list the methods that can be overridden?

556






What is ascii format?

526


What are 3 boolean operators?

507


What's the base class in java from which all classes are derived?

710


What is the difference between applet and application?

524


Why we use protected in java?

509


what is server side caching?

1578


Will set allow duplicates in java?

479


What does void * mean?

506


What does math floor () do?

533


How many characters is 16 bytes?

520