In the first program, the method parameters to the "swapping" method have the same names as the member variables, but you use "this" to disambiguate the two. In the second program, there's only one parameter, and it has the same name as one member variable, but you don't use the class name to disambiguate, so while Test2.i2 gets reassigned, Test2.i1 does not. See?
In the above code the parameter is said to "hide" the member because they have the same name. When a paramter hides a member you can refer to the member by prefixing it with the keyword "this". Consequently, in the above code while within m() "o" refers to the parameter (object 2) and the only way to access the member (object 1) is to refer to it by "this.o". If you didn't understand Ernest before reading this, try reading his reply again and it should make sense.
They worship nothing. They say it's because nothing lasts forever. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking