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 |
What is the difference between Byte stream and Charecter Stream?
what is difference betwenn Access Specifier and Access Modifier ????
please send code example of inner classes?
Can Applet have constructors?
To obtain design information about an object, which class in used?
What is a container in a gui?
what is generics in jdk1.5?
What do you understand by abstract classes?
What is the definition of tree ?
what happens when a thread cannot acquire a lock on an object? : Java thread
Is string thread safe in java?
Why we go for collections in java?