When is an object in the mean to garbage collection?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sathya
When the object is no longer referenced, its eligible for
Garbage Collection
| Is This Answer Correct ? | 0 Yes | 1 No |
Difference between predicate, supplier and consumer ?
Why does java not allow multiple public classes in a java file ?
What is vector capacity in java?
Explain what is Marker interface?
why interfaces are faster than abstract classes?
What is externalizable interface?
What are the characteristics provided in jdk1.6 apart from other versions?
What is an argument in java?
please send me hr interview questions in it industry
what is the difference between String and StringBuffer classes?
How do you use parseint in java?
What is final?