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 |
Does java set allow duplicates?
What is computer compiler?
What is sortedmap in java?
Which collection object is faster to retrieving the data and inserting the data into it.
2 Answers Jamcracker, Virtusa,
What will be the output of the program? public class Test { public static void main(String args[]) { ArrayList<String> list = new ArrayList<String>(); list.add("2"); list.add("3"); list.add("4"); list.add("5"); System.out.println("size :"+list.size()); for(int i=0;i<list.size();i++) { list.remove(i); } System.out.println("size after:"+list.size()); } }
I need some details about an employee. i have only the employee id in my presentation layer(JSP).I entered that ID and click "Show Details" Button. Question is how the JSP pass that id to Controller layer and DAO and what mechanism we are using to retrive data from DB and how the data passed to JSP as a Output. Please explain in detail.
What is nextline method in java?
how session will be expired?
what is the difference between static block and static method
Java support what type of parameter passing ?
What is constructor chaining and how is it achieved in java?
what is the need to set path in java? how many ways to set path in java? Explain breif?