Array answer[i] to if Java -
int count=0,answer[2,4,3,2,1];
the problem :" ']' expected
.
how solve want first answer answer[0]
second answer[1]
, all.
you cannot use regular int
declaration array unless include brackets in variable name answer[]
, also, array values defined curly braces:
int count = 0; int[] answer = {2,4,3,2,1};
or
int count = 0, answer[] = {2,4,3,2,1};
Comments
Post a Comment