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 significance of continue jump statement? Explain with an example.

0 Answers   Amdocs,


What are File and RandomAccessFile classes?

2 Answers  


Difference between Choice and a List?

1 Answers  


what is jndi?

1 Answers   TCS,


What is anagram number?

0 Answers  






How do you start a thread?

0 Answers  


who can we create the object of a class? in how many ways we can create it (max 5)

2 Answers  


What is parameter tag and what is its use?

1 Answers  


What is difference between path and classpath variables?

0 Answers  


What makes a function well defined?

0 Answers  


byte a=5; byte b=5; byte c=a+b; System.out.println(c); whats the o/p?

7 Answers   NIIT, Wipro,


What do you mean by exception handling in Java?

0 Answers   Atos Origin,


Categories