Guys,
If you didn't know the one and only parameter passing mechanism
Java uses is pass by value. In case of primitives the primitive value is passed by value, in case of references - refernce to an object is passed by value (not the object of course, so this creates a misconception that Java passes parameters by reference in case of objects). You were right, Integer(99) is a candidate for GC after line 6. To add, assignments to x within this method do not affect the reference that x was copied from, so if I call m like this:
<pre>
Object y = new X();
y.m(y);
</pre>
y will point to object of type X all the time, even after line 3 in m is run.
Vlad.