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

Is a boolean 1 bit?

0 Answers  


Differentiate between a class and an object.

0 Answers  


What are the characteristics provided in jdk1.6 apart from other versions?

3 Answers   TCS,


What is a loop java?

0 Answers  


What is the frontend and backedn in Java?

3 Answers   TCS,






Is there any way to skip finally block of exception even if some exception occurs in the exception block?

0 Answers  


public class Base { public void myMethod(int a,intb) {} } // Uses myMethod and then hides it. public class DerivedOne extends Base { private void myMethod(int a,int b); } will this compile or not .yes or no. why

2 Answers  


What is the use of static keyword in "public static void main()"

10 Answers   College School Exams Tests, Infosys, Six Dee Telecom,


What is a linkedhashmap java?

0 Answers  


What is OOPs & Why?

3 Answers  


What is multithreading and its advantages?

0 Answers  


What is a values collection view ?

0 Answers  


Categories