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

how do you store phone numbers using java collections

5 Answers   Bosch, IBAB,


What is Distributed Application and what is its usage?

2 Answers  


What is the difference between yielding and sleeping in java programming?

0 Answers  


Is java still necessary?

0 Answers  


What language is pass by reference?

0 Answers  






What value is a variable of the string type automatically initialized?

0 Answers  


What is your platform?s default character encoding and how to know this?

0 Answers   TCS,


Is java util list serializable?

0 Answers  


what is mutual exclusion? How can you take care of mutual exclusion using java threads? : Java thread

0 Answers  


What is the difference between the >> and >>> operators?

1 Answers  


class A { public void disp(int a,int b) { System.out.println("hai"); } } class B { public void disp(int a,int b,int c) { System.out.println("hai"); } } above program is overloading or overriding?

9 Answers   Infosys, Wipro,


What is module in project?

0 Answers  


Categories