What is garbage collection in Java, and how can it be used ?
Answer Posted / janet
When an object is no longer referred to by any
variable,java automatically reclaims memory used by that
object.This is known as garbage collection.
System.gc() method may be used to call it explicitly.
| Is This Answer Correct ? | 182 Yes | 34 No |
Post New Answer View All Answers
Can you give names of Container classes?
Can you start a thread twice in Java?
What happens if an exception is throws from an object's destructor?
Why constructor has no return type?
Why destructor is not used in java?
Explain thread in java?
Why do we use predicate in java?
Explain notifyall() method of object class ?
Can we override private methods?
Are there structures in java?
What is difference between null and void?
Detail discussions on JVM, memory management and garbage collector.
What is a stringbuilder?
What are register variables what are the advantages?
why an outer class cannot be declared as private?