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

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -