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

What methods are used to get and set the text label displayed by a button object?

0 Answers  


Why const and goto are reserved keyword in java?

1 Answers  


What classes of exceptions, thrown by a throw statement?

2 Answers  


How do you achieve polymorphism in java?

0 Answers  


Explain the importance of finally over return statement?

0 Answers  






what is daemon thread and which method is used to create the daemon thread? : Java thread

0 Answers  


what is difference between perfom() & excute() ?

2 Answers   IBM,


What is difference between static class and normal class?

0 Answers  


explain the concept of inheritance with an example?

9 Answers   Polaris,


Can we have multiple catch block for a try block?

0 Answers  


What is equlas() and hashcode() contract in java? Where does it used?

0 Answers  


What are decalarations?

0 Answers  


Categories