When is an object in the mean to garbage collection?

Answers were Sorted based on User's Feedback



When is an object in the mean to garbage collection?..

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

When is an object in the mean to garbage collection?..

Answer / ravikiran

when it is not reffered by any active thread

Is This Answer Correct ?    0 Yes 0 No

When is an object in the mean to garbage collection?..

Answer / sathya

When the object is no longer referenced, its eligible for
Garbage Collection

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

Explain about method local inner classes or local inner classes in java?

0 Answers  


Difference between string, string builder, and string buffer?

0 Answers  


which one is performance wise advantageious from List,Set,Map?

6 Answers  


What is the difference between serializable and externalizable interfaces?

0 Answers  


How do you compare characters in java?

0 Answers  






can we create object for static class in java

14 Answers   IAP Company, IBM, Marlabs, mPortal, TCS,


What are different types of constants?

0 Answers  


Why we used vector class?

0 Answers  


What is a key in java?

0 Answers  


What are the types of relation?

0 Answers  


What does s mean in regex?

0 Answers  


What is a type parameter in java?

0 Answers  


Categories