posted 14 years ago
Given the code. Which line of code marks the earliest point that an object referenced by myInt becomes a candidate for garbage collection?
[code]1. public void doStuff() {
2 Integer arr[] = new Integer[5];
3 for (int i = 0; i < arr.length; i++) {
4 Integer myInt = new Integer(i);
5 arr[i] = myInt;
6 }
7 System.out.println("end");
8 }
options are :- 1 2 3 4 5 6 7
My answer :- after 8.
Please suggest ???
SCJP 6.0 96%
(Connecting the Dots ....)