Can anybody explain me this. Why is it returning:
1,3
Code:
--------------------------------------------------------------------------
public class Casting06 {
static void m1(int[] i4, int[] i5) {
int[] i3 = i4; i4 = i5; i5 = i3;
}
public static void main (
String[] args) {
int[] i1 = {1}, i2 = {3}; m1(i1, i2);
System.out.print(i1[0] + "," + i2[0]);
}
}
---------------------------------------------------------------------------
Output:1,3 While the expected answer is 3,1