int a[]={1, 2, 3, 4, 5};
int b[]={4, 3, 2, 1, 0};
a=b;
System.out.println("a[0] = "+a[0]);
This displays a[0] = 4 as obvious because a is assigned a reference to b.
If it is modified as follows
int a[]={1, 2, 3, 4, 5};
int b[]={4, 3, 2, 1, 0};
System.out.println("a[(a=b)[0]] = "+a[(a=b)[0]]); //<-------
then, it displays a[(a=b)[0]] = 5.
Why doesn't this expression - a[(a=b)[0]] yield 4, the 0th element of b even though it appears to be the same as the previous case?