Originally posted by Jothi Shankar Kumar Sankararaj:
Hi Guys,
Consider the code below,
The above code prints 1, 3
And the code below,
prints 3, 1
Can you guys please explain this?
Thanks in advance.
Notice in the first code that there is nothing within the method that has any effect on the array references sent to it.
In the second code, the elements of the arrays are actually swapped.