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 happens when heap memory is full?

0 Answers  


What is the use of put method?

0 Answers  


What is double parsedouble in java?

0 Answers  


What is volatile keyword in java

0 Answers  


What is ternary operator?

0 Answers  






What is java ceil?

0 Answers  


why the primitive data type have classes?

4 Answers  


According to java operator precedence, which operator is considered to be with highest precedence?

0 Answers  


What is a java developer salary?

0 Answers  


What is a variable declaration?

0 Answers  


How can the checkbox class be used to create a radio button?

0 Answers  


How can you take string into InputStream?

3 Answers  


Categories