What is garbage collection in Java, and how can it be used ?
Answer Posted / samji
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 ? | 4 Yes | 6 No |
Post New Answer View All Answers
What do you mean by global variable?
What does this () mean in java?
What is difference between string and stringbuffer?
Can we clone singleton class in java?
Describe the syntax of multiple inheritance? When do we use such an inheritance?
What is main difference between variable and constant?
when you will synchronize a piece of your code? : Java thread
What are the types of arrays in java?
Explain hashset and its features?
What are the 8 primitive data types in java?
Garbage collection in java?
What about main() method in java ?
Can we sort array in java?
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?
What are examples of modifiers?