If circular link of two objects, then will it be garbage
collected ?
Answer Posted / 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 |
Post New Answer View All Answers
How do you include a string in java?
How do you add an element to a set in java?
explain what is transient variable in java?
What is the use of volatile in java?
Does every java program need a main?
Why is java called java?
What is the use of flag?
What are the differences between heap and stack memory in java?
What are the object and class classes used for?
How do you do math powers in java?
How do you sort arrays in java?
When is update method called?
What does null mean in java?
What is formatted output in java?
What do you mean by local variable and instance variable?