posted 18 years ago
after m1 completes, objects originally referenced by i1,i2,i3,i4 will be elegible for GC. (i1,i2,i3 and i4 are local variables of m1() and nothing outside objects referenced by i1,i2,i3,i4 references these objects)
(i4 - after m1() finished, the object is only referenced from itself and so it is unreachable.)
After line new J().m1() also the J object will be elegible for GC - its reference is not stored in any variable.