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 is the role of the java.rmi.naming class?
What are the actions that can occur when a thread enters blocked state?
Does sprintf allocate memory?
What is java and why do we need it? Explain
Is it possible to write a regular expression to check if string is a number?
State two differences between C and Java.
What is a Null object?
Why do we need hashmap in java?
What all methods are used to prevent thread execution ?
How variables are stored in memory?
What are thread local variables?
What method is used to know the status of Checkbox(i.e it is checked or unchecked)?