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
Describe what a thread-local variable is in java?
when should you use stringbuilder class in a program?
What is indexof?
What is the mapping mechanism used by java to identify IDL language?
What two classes are used to read data only?
What is size () in java?
What is difference between ++ I and I ++ in java?
What is the default access specifier for variables and methods of a class?
What does compareto () do in java?
Can we override the static methods?
What is Java Reflection API? Why it’s so important to have?
Explain Basics of OOP Language in java
What are adapter classes?
How do I get a substring?
What is object of class in java?