indexing array in static class
in
Programming Questions
•
2 months ago
Hey all,
I am having a bit of an issue with indexing a value into an array. I have incoming values that are changing, and I want to store these in a 2 element array and compare. I seem to be getting a token error that is due to my "small class" for the static variable. code below:
-
static class ID_CHECK{public static int[] numbers = new int[2];
public static int i = 0;// " id" is the incoming/changes value
numbers[i] = hand_id; //hand_id is the value comparing. the values change.i = i + 1;
if (i == 1) {int ID1 = numbers[0];int ID2 = numbers[1];println(ID1 + "..." + ID2 );}
1