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 | 16 No |
Post New Answer View All Answers
What is the size of boolean variable?
What is consumer interface?
What is main function purpose?
Tell me the latest versions in java related areas?
What is module in project?
Explain what access modifiers can be used for methods?
What does the “static” keyword mean? Can you override private or static method in java?
How objects are stored in java?
what is the difference between thread and runnable types? : Java thread
What is a class variable?
How do you compare two strings lexicographically?
What is a Hash Table? What are the advantages of using a hash table?
What is meant by data hiding/encapsulation?
What are inner classes or non static nested classes in java?
What are register variables what are the advantages?