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 ? | 324 Yes | 35 No |
Post New Answer View All Answers
What is immutable in java?
Which sorting is best in java?
What is the use of java?
How can we make a class virtual?
What is a double vs float?
do I need to use synchronized on setvalue(int)? : Java thread
What is sortedmap in java?
Can an interface extend a class?
Can you access non static variable in static context?
What is the difference between import java.util.date and java .util?
How can we use primitive data types as objects?
Why is a singleton bad?
Can we return null in java?
How static variable work in java?
Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.