What is garbage collection in Java, and how can it be used ?
Answer Posted / pranab dutta
When a Java object becomes unreachable to the program, then
it is subjected to garbage collection. The main use of
garbage collection is to identify and discard objects that
are no longer needed by a program so that their resources
can be reclaimed and reused.
| Is This Answer Correct ? | 325 Yes | 35 No |
Post New Answer View All Answers
Can we use return in constructor?
Why is singleton not thread safe?
What is the difference between iterator and enumeration ?
What is the benefit of abstract class?
These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }
What are the parts of a method?
How do you define a singleton class?
What is thread pool in java with example?
Can list contain null in java?
What is return keyword in java?
Where are global variables stored?
What types of index data structures can you have in java?
What about anonymous inner classes in java?
What is a type parameter in java?
Can an integer be null java?