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 oop principle in java?
1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?
What is the difference between the size and capacity of a vector?
What is set string?
How are destructors defined in java?
What is codebase?
What is the purpose of the return statement?
Can we declare the main method of our class as private?
What is default constructors?
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
What is the common usage of serialization? What exceptions occur during serialization?
What is data and its types?
What does int argc char * argv [] mean?
What are the major advantages of internal iteration over external iteration?
What is break and continue statement?