Garbage Collection
© examsiri.com
Question : 2 of 7
Marks:
+1,
-0
Given:
Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?
1. public void genNumbers() {
2.   ArrayList numbers = new ArrayList();
3.   for (int i=0; i<10; i++) {
4.    int value = i * ((int) Math.random());
5.    Integer intObj = new Integer(value);
6.    numbers.add(intObj);
7.   }
8.   System.out.println(numbers);
9. }Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?
Go to Question: