Hello all:
I am wondering the answer to this question on dan's
test:
void m1() {
Q q1 = null;
for (int i = 0; i < 10; i++) {
q1 = new Q(); // 1
m2(q1); // 2
}
System.out.print("All done"); // 3
}
When the processing of line 3 begins, how many objects of type Q that were created at line 1 have become eligible for garbage collection?
a. 0
b. 1
c. 9
d. 10
e. Indeterminate.
f. Compile-time error
g. Run-time error
h. None of the above
---
Answer according to Dan's site is [e]. Having said that if you observe the question carefully & go nuts about the method 'm2(q1)' and wondering where in the world is the 'meat' for m2(), that made me select the option [F], 'F' like in flower...and after reading the answer, I am not sure if my thinking was normal or abnormal.
Any suggestions are appreciated. In the morning I felt greatly motivated to prepare for
SCJP. Having read the smallest topic (Garbage C), and after taking the test at dan's, I feel a bit confused ??
--thanks
VJ