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 happens when a thread cannot acquire a lock on an object? : Java thread
What is function overriding and overloading in java?
What is reverse function?
What are the 4 types of characters?
I want to print “hello” even before main is executed. How will you acheive that?
What is the difference between hashmap and hashtable in java?
Why java is call by value?
What are the important features of Java 11 release?
What is the java reflection api? Why it’s so important to have?
What do you mean by inner class in java? Explain
What is dynamic array in java?
In how many ways we can do synchronization in java?
How can constructor chaining be done using this keyword?
What a static class can contains?
What does system out println () do?