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 the effect of keeping a constructor private?

0 Answers  


write a program that list all permutations of ABCDEF in which A appears before B?

0 Answers   Nissan,


What is java jit compilers?

0 Answers  


How can you write a loop indefinitely in java programming?

0 Answers  


Why string is a class?

0 Answers  






What is the purpose of the strictfp keyword?

0 Answers  


Why object class is super class for every class in java?

0 Answers  


Sample code to retrieve objects from HashMap in sorted ascending order?

2 Answers  


How to sort numbers in java without array?

0 Answers  


Urgent requirement of JAVA/.NET/QA in a CMMI level3 MNC for Pune location.

0 Answers  


What is general methodology?

0 Answers  


What is the difference between actual and formal parameters?

0 Answers  


Categories