What is garbage collection in Java, and how can it be used ?
Answer Posted / ms
garbage collecton in java means, if a particular object in
a program is not being refered since long time then it will
be automatically deleted with the help of garbage collector
so that some amount of memory is saved.we can explicitily
call it by adding a method system.gc()in the program.so in
this case there is no need to use'destructor'to destroy the
objects.
| Is This Answer Correct ? | 70 Yes | 17 No |
Post New Answer View All Answers
What is the purpose of the return statement?
What all access modifiers are allowed for top class ?
Can a constructor be made final?
What is the different types of functions?
What are different types of references?
Why declare Main() inside the class in java ?
Why are variables important in research?
What is difference between Heap and Stack Memory?
Explain about the select method with an example?
How do you sort in descending order in java using collections sort?
What is final method?
What is the difference between sleep and wait in java?
What steps are taken when the OS shifts from one-thread execution to another?
How does singleton class work?
How to overcome the exception object reference not set to an instance of object?