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 exception propagation?
What is the final keyword denotes?
Can a private method be declared as static?
What is private public protected in java?
What is the difference between equals() and == in java?
How do you find the maximum number from an array without comparing and sorting?
Explain the reason behind ending a program with a system.exit(0)?
Explain static nested classes ?
What is the primitive type short?
What is java full form?
What is a blocking method in Java?
How to change the priority of thread or how to set the priority of thread?
How do you clear a method in java?
how many types of Inheritance?
What is java argument list?