All parameter passing in Java is by value. When you send a reference as a parameter, a copy of the reference is sent. So if you assign the formal parameter in the method to point to another object inside the method, it has no effect on the reference you send.
Because you are sending reference types to the method processtacks.
So in the method processstacks x1 refers to the same object as s1 and x2 refers to the same object as s2.
In these method you push an Integer which pushes this to the same object than s1 refers to. Next you are refering x2 to the same object as x1 and this is s1. After the method processstacks x1 and x2 are lost.
So you still have s1 and s2 refering to different objects. In which s1 has an Integer("100"). Changing refering x2 to x1 to s1 doesn't change the reference of s2, because x2 is a copy of s2 which is only active in the method processstacks