If circular link of two objects, then will it be garbage
collected ?

Answers were Sorted based on User's Feedback



If circular link of two objects, then will it be garbage collected ?..

Answer / uppaluri

No

Is This Answer Correct ?    7 Yes 1 No

If circular link of two objects, then will it be garbage collected ?..

Answer / rt

Yes it will be garbage collected.

e.g.

public void testMethod(){
A a= new A();
B b = new B();

a= b;
b= a;

}
After above method get executed Object a & b will be garbage
collected.

Is This Answer Correct ?    3 Yes 3 No

If circular link of two objects, then will it be garbage collected ?..

Answer / dhanunjay

I think not so,because that will be reused allocated memory for both....Here not to waste our memory

Is This Answer Correct ?    4 Yes 7 No

Post New Answer

More Core Java Interview Questions

What is member in java?

0 Answers  


What are parsers? Dom vs sax parser.

0 Answers  


Discuss different types of errors that generally occur while programming.

0 Answers   Amdocs,


Is it necessary that each try block must be followed by a catch block?

0 Answers  


What are the OOPS concepts in Java ?

4 Answers   Satyam,






why are wait(), notify() and notifyall() methods defined in the object class? : Java thread

0 Answers  


can we create a instance for intwerface?

3 Answers  


How many boolean functions are there?

0 Answers  


What is a lock or purpose of locks in java?

0 Answers  


What is array command?

0 Answers  


How do I find and replace in word?

0 Answers  


What is final keyword?

0 Answers  


Categories