A
ankur.pathela
Hi All,
I tried the following code in java:
/************************/
int i=0;
int[] arr={10,20,30};
arr=i=1;
/************************/
It changed arr to {1,20,30}
I aquaint to have written a similar code in C long time back and the
array was then changed to {10,1,30} (Please correct me if I am wrong).
Even in java, associativity is from right to left in case of '='
operator. Then why is this happening?
Regards,
Ankur
I tried the following code in java:
/************************/
int i=0;
int[] arr={10,20,30};
arr=i=1;
/************************/
It changed arr to {1,20,30}
I aquaint to have written a similar code in C long time back and the
array was then changed to {10,1,30} (Please correct me if I am wrong).
Even in java, associativity is from right to left in case of '='
operator. Then why is this happening?
Regards,
Ankur