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

Define linked list and its features with signature?

537


Write a program to find the whether a number is an Armstrong number or not?

571


Can we call the run() method instead of start()?

582


Can a class have multiple subclasses?

581


What are the advantages of autoboxing?

535






What is an escape character in java?

525


What is flag in java?

527


What is passing parameters in java?

509


What is the size of string?

554


What is array size in java?

492


What is gc()?

573


Can an abstract class be a final class?

527


What is linked hashmap and its features?

536


What is java regex?

528


Which is faster call by value or call by reference?

497