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
Explain java code for recursive solution's base case?
What is static import in java?
What is java object name?
What is a values collection view ?
What is the purpose of the wait(), notify(), and notifyall() methods in java programming?
What is the use of isempty in java?
Explain what access modifiers can be used for variables?
What are the main differences between notify and notifyAll in Java?
What do you mean by platform independence of Java?
In a container there are 5 components. I want to display the all the components names, how will you do that one?
What are the differences between c++ and java?
What is an empty list in java?
What is binary tree in java?
Explain what pure virtual function is?
How many types of assembly languages are there?