What is garbage collection in Java, and how can it be used ?
Answer Posted / devarathnam c,kotagudibanda(po
Hi...
GarbageCollector: Whenever an object is no longer used in
the program at that time the garbage collector reclaims the
memory of an object.It is controlled by the JVM ,The JVM
runs periadically by using "mark" and "sweep"algorithms.
Instead of "destructor" in c++ , java supports garbage
collector.
| Is This Answer Correct ? | 84 Yes | 21 No |
Post New Answer View All Answers
Explain about class in java?
How can you add and remove nodes in jtree?
how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread
Describe the process as to how substring() methodology mechanisms in java.
How many bytes are there?
Difference between comparator and comparable in java?
Can an object subclass another object?
Give the hierarchy of inputstream and outputstream classes.
What are the high-level thread states in java programming?
What is nan inf?
Explain different ways of creating a thread. Which one would you prefer and why?
If an object reference is set to null, will the garbage collector immediately free the memory held by that object?
What are thread priorities and importance of thread priorities in java?
Can we override constructor?
Explain the difference between hashmap and hashtable in java?