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 |
What happens when heap memory is full?
What is the use of put method?
What is double parsedouble in java?
What is volatile keyword in java
What is ternary operator?
What is java ceil?
why the primitive data type have classes?
According to java operator precedence, which operator is considered to be with highest precedence?
What is a java developer salary?
What is a variable declaration?
How can the checkbox class be used to create a radio button?
How can you take string into InputStream?