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 the base class for error and exception?
What is passing by reference in java?
What is a boolean structure?
What is the difference between serial and throughput garbage collector?
What is api in java?
Explain the reason behind ending a program with a system.exit(0)?
What is the use of string and stringbuffer?
Can we serialize static variables in java?
Why isn’t there operator overloading?
What is data object example?
How do you define a variable?
How does callback work in java?
How is hashcode calculated in java?
What is a constructor, constructor overloading in java?
Can we convert integer to string in java?