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 final class?
Can a class have multiple superclasses?
Can we have try block without catch block?
Can a string be null?
What is difference between static class and singleton pattern?
Can we serialize static variables in java?
What is logical variable?
What is difference between static class and normal class?
What is the major advantage of external iteration over internal iteration?
What is the effect of keeping a constructor private?
explain what is transient variable in java?
What is the use of toarray () in java?
What is unmodifiable list in java?
What programs use java?
What is the java reflection api? Why it’s so important to have?