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
Define linked list and its features with signature?
Write a program to find the whether a number is an Armstrong number or not?
Can we call the run() method instead of start()?
Can a class have multiple subclasses?
What are the advantages of autoboxing?
What is an escape character in java?
What is flag in java?
What is passing parameters in java?
What is the size of string?
What is array size in java?
What is gc()?
Can an abstract class be a final class?
What is linked hashmap and its features?
What is java regex?
Which is faster call by value or call by reference?