Well arrays are exactly wath you need,
heres a example code:
public class Arrayer {
private int number_Of_Numbers = 9;
private int[] number = new int[number_Of_Numbers]; // or just new int[9]
for (int i; i < number_Of_Numbers; i++){
number[i] = i // making the array number[0] = 0, number[1] = 1, etc
}
// so you can use them like
number[3] = 5;
number[2]++;
}
But arrays always starts with cero, so int[] array = new int[5], will make 5 ints starting with array[0] and ending with array[4]
you can make any object array, you can make Button[] Butt = new Button[4], making 4 buttons, and in the init method a for loop is used to initialize them - for(int r; r < 4, r++){ Button[r] = new Button(“button”); Button[r].addActionListener(this); add(Button[r]); }
…
so your code will look like{
int[] var = new int[9];
for(int i = 0; i < 9; i++)
{
var[i] = 1; // making all variables value 1
}
then you will have var[0], var[1], …, var[9];
[b]Google for more Java arrays information [/b] :)
i Hope this helped you