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
What is a condition in java?
What are the legal parameters?
when you will synchronize a piece of your code? : Java thread
how to split string in java?
What does a za z0 9 mean?
Is final static java?
How to create a custom exception?
What is a singleton class in Java?
Define how does a try statement determine which catch clause should be used to handle an exception?
What is canonical name in java?
What is stringbuffer in java?
Does every java program need a main?
How to do encapsulation in java?
Where is singleton pattern used?
Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?