Began to learn java. Compiled such code:
int a[]; int b[]; int c[]; b = c = [3]; System.out.print(b + " " + c);
There was an error in the penultimate line:
Syntax error on token "=", Expression expected after this token
How to fix?
Began to learn java. Compiled such code:
int a[]; int b[]; int c[]; b = c = [3]; System.out.print(b + " " + c);
There was an error in the penultimate line:
Syntax error on token "=", Expression expected after this token
How to fix?
or so
int b[]; int c[]; b = c = new int [3];
we create 2a arrays B and C, and then we initialize them by selecting them with the size of 3 cells. And B and C will be links to one array.
b = c = [3];
How to fix?
And what did you even try to do?
I suppose to create 2 arrays on the 1st element equal to 3.
int b[] = new int[] { 3 }; int c[] = new int[] { 3 }; System.out.print(b[0] + " " + c[0]);
Source: https://ru.stackoverflow.com/questions/160604/