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
What is OOP Language?
Give an example of use of pointers in java class.
How do you make a thread in java?
What is private protected in java?
Where and how can you use a private constructor?
What is the difference between abstraction and encapsulation?
What is consumer in java?
How many types of the indexof method are there for strings?
What is a java object and java application?
How to avoid memory leak in java?
What is a copy constructor in java?
What is difference between static class and singleton pattern?
What is the difference between heap memory and stack memory?
Is it possible to override the main method?
Is static variable stored in heap?