Originally posted by Aiglee Castillo:
It says the answer is A, because the array, but what about the variable i of the loop??
Only "Objects" are Garbage-collected. Not the variables. (Variables hold either references to objects or values of primitives)
to put in other words, only those things are GC'ed which are created by using "new" operator. (Lets keep
String literals aside) In your code, did you create "i" by saying something line new i() ?