Hi Netty,
I got the reson.
If u look closely the entire thing is the magic of pointers.
Though there is no pointer in
Java, but whenever an object
is stored in java, it is always stored by reference. And
an array is an object(in Java).
Now what is happening here.
1. First u r storing 3,4,5 in a1
2. Then u are passing the pointer to of a1 to fix.
3. In fix a3 gets the pointer of a1.
4. a3's value is modified.
5. Then u are transfering the pointer of a3(that is a1) to a2.
6. Ultimately, all the values are changed(a1,a2,a3).
I dont know whether I am able to answer u or not.
Reply if u have not got me.
Arnab