I have run the sample on paper. To me the answer is 1 because only the object which got created inside m1
is available for garbage collection as no living references exist. I guess this site needs to update their answer
or may be the question source is incomplete because it calls some other method after that its a dead-end. So
answer is 1.