Basically, objects (like arrays) are passed into methods "by reference". So when you change the object, it changes the same object that was passed into the method.
Primitives (like int) are "passed by value", so the variable you are assigning a value to in a is not the same as the int variable that was passed in.
I hope this helps...