Can an object be garbage collected while it is still
reachable?

Answer Posted / sudheer

Garbage collector is a low priority thread. We cant order to delete an object. When the object has no references and object which are out of scope will be deleted by the garbage collector to free the memory. So when an object is reachable it cant be garbage collected.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can the garbage collection be forced by any means?

529


What is the use of isempty in java?

535


How do you use compareto?

549


Explain JMS in detail.

614


Why do we use bufferedreader?

535






Can I override protected method in java?

594


what is meant by Garbage collection?

619


What is difference between static variable and global variable?

548


Describe the various concepts related to object oriented programming (oop).

586


What are the methods available in a class?

587


How big is a pointer?

553


Why is a constant variable important?

501


Can java inner class be static?

557


Give reasons supporting that string is immutable.

496


What is dot operator?

574