If circular link of two objects, then will it be garbage
collected ?
Answers were Sorted based on User's Feedback
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 |
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 |
How is the marker interface used in Java?
what is jms? features of jms
What is an object in java and how is it created?
When is the finally clause of a try-catch-finally statement executed?
Is empty list java?
why java does not support unsigned keyword?
we cannot create an object of interface but we can create a variable of it
why java does compile time polymorphism at run time ?
What is return code?
How OOPS concept is achieved in Java?
6 Answers Cognizant, JPMorgan Chase, Xavient,
Why do we need variables?
Which method returns the length of a string?