Hi Ranchers,
Please consider the following code....
This is a question from WhizLabs.
Question:How many objects will be eligible for garbage collection before System.gc() is executed?
The given answer is 3.
I thought it was none since we only pass a
reference of array object to the method f(array)and also since array variable in f() method is local to that method, it doesnt affect the array var in the main method.
Could anyone shed some light on it?
Thanks in advance.
-Sharmila Rishi.