[Solved] Array answer[i] to if Java


You cannot use a regular int declaration for an array unless you include brackets in the variable name answer[]. Also, array values are defined with curly braces:

int count = 0;
int[] answer = {2,4,3,2,1};

or

int count = 0, answer[] = {2,4,3,2,1};

3

solved Array answer[i] to if Java