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 string data type?
What is the importance of finally block in exception handling?
Hi.... I applied for the post of scientific officer/Engineer-SB(Programmer).Please post the syllabus and sample papers.
What’s a deadlock?
What is the purpose of the system class in java programming?
What is default exception handling in java?
What is the latest version of java?
What is the difference between serializable and externalizable interfaces?
What is the purpose of garbage collection in java? When is it used?
Explain a few methods of overloading best practices in java?
Write the algorithm to check the number non-leaf nodes in a tree.
In how many ways we can do exception handling in java?
What is a nullable field?
What is stringwriter?
What is bufferedwriter?