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 |
is it mandatory to deaclare all variables public static fianl in interfaces?if i declare like in the below program, public interface A { public static final int I=0; int j=0; } in interface A,what is the difference between I,j?
Can a method inside a interface be declared as final?
How do you decide when to use arraylist and linkedlist?
Can you achieve runtime polymorphism by data members?
How do you classify Dialog Box?
How objects of a class are created if no constructor is defined in the class?
Is it necessary that each try block must be followed by a catch block?
Name the runtime exceptions that occurs frequently?
Can we pass a primitive type by reference in java? How
what is j2se
Does constructor return any value?
What is the frontend and backedn in Java?