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 a boolean 1 bit?
Differentiate between a class and an object.
What are the characteristics provided in jdk1.6 apart from other versions?
What is a loop java?
What is the frontend and backedn in Java?
Is there any way to skip finally block of exception even if some exception occurs in the exception block?
public class Base { public void myMethod(int a,intb) {} } // Uses myMethod and then hides it. public class DerivedOne extends Base { private void myMethod(int a,int b); } will this compile or not .yes or no. why
What is the use of static keyword in "public static void main()"
10 Answers College School Exams Tests, Infosys, Six Dee Telecom,
What is a linkedhashmap java?
What is OOPs & Why?
What is multithreading and its advantages?
What is a values collection view ?