When is an object in the mean to garbage collection?
Answer Posted / chandrarekha
whenever the object goes out of scope or when it is no
longer being referenced, in such cases it can be a garbage
object. Garbage collection is implicitly invoked whenever
resources have to be allocated to the new objects that are
created and approach to detect a garbage object can be done
through reference-counting collectors,tracing
collectors,compacting collectors. The garbage collectors
can also be explicitly invoked by gc() supported by JVM
which is in the java.lang package
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is the preferred size of a component in java programming?
How can we make string upper case or lower case?
What is object english?
Does java return by reference?
What about main() method in java ?
Difference between Linked list and Queue?
How to create a thread in java?
Can a serialized object be transferred via network?
Can size_t be negative?
What does a boolean method return?
Can memory leak in java?
Why wait and notify methods are declared in object class?
What is the difference between method and means?
What is externalizable?
Difference between Preemptive scheduling vs. Time slicing?