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
Explain restrictions for using anonymous inner classes?
How do I print a “?
What is difference between final and finally in java?
How do listeners work?
Can we create an object of static class in java?
What are the data types supported by java? What is autoboxing and unboxing?
How you can force the garbage collection?
How we can generate random numbers in java?
Which command from the jdk compiles a java program?
Explain the difference between comparator and comparable in java?
Define iterator and methods in iterator?
What is output buffer?
What are data types in oop?
What is threaded programming and when is it used? : Java thread
What is the benefit of lambda expressions?