What is garbage collection in Java, and how can it be used ?
Answer Posted / syed sikandar bakht
when an object in memory is no longer refered by a variable,
the garbage collector automatically move it to garbage
collection.
instead of calling destructor JVM do it automatically, as we
use destructor in c++ to destroy the object.
| Is This Answer Correct ? | 20 Yes | 6 No |
Post New Answer View All Answers
What should I import for arraylist in java?
What are synchronized methods and synchronized statements in java programming?
Can we override private methods?
What class allows you to read objects directly from a stream in java programming?
How do you remove all elements from an arraylist in java?
What is default constructors?
Can you call a method in a method?
What is a class component?
what do you mean by marker interface in java?
Which of the classes will have more memory allocated?
What is += mean in java?
How is hashcode calculated in java?
What is java thread dump, how can we get java thread dump of a program?
What is the purpose of sizeof operator?
What is boolean law?