int arr[][] = new int[3][4];
int row[] = {1,2,3,4};
arr[0] = {1,2,3,4}; // why this doesn't work?
arr[0] = row; //when this line works
In above code, why we can't initialize row of array with {1,2,3,4}
directly (on line3
).
int arr[][] = new int[3][4];
int row[] = {1,2,3,4};
arr[0] = {1,2,3,4}; // why this doesn't work?
arr[0] = row; //when this line works
In above code, why we can't initialize row of array with {1,2,3,4}
directly (on line3
).