hello all, can someone give me an explanation how many objects are available for gc after this code executes with count=3. void process(int count) { for(int i=0;i<count;i++)> { Object o="hello"+i; } }
RHE says,method locals and arguments are allocated space on the stack and are discarded when the method exits - which is the case here.Here o is a local variable and garbage collection is not in question here (it doesn't matter how many times the iteration goes on).So I think nothing is garbage collected. Elizabeth.
Tongue wrestling. It's not what you think. And here, take this tiny ad. You'll need it.
a bit of art, as a gift, that will fit in a stocking