Help me! java.lang.ArrayIndexOutOfBounds exception keeps coming up
Ok, here is my program. Its a very simple program to find the integer factors of an integer number.
[code][code]class NumFactorer {
public static void main (String arguments[]){
int divisor = 1;
int number = 9;
int z = number;
int result = 0;
double i = 0;
int s = 1;
int Resultarray[][] = new int[2][9];
while(divisor<(number/2)) {
i = number%divisor;
if(i == 0){
result = number/divisor;
Resultarray[1][s] = divisor;
Resultarray[2][s] = result;
}
divisor++;
s++;
}
System.out.println(Resultarray[1][1]);
}
This program compiles fine, but when I try to run it, it throws the java.lang.ArrayIndexOutOfBoundsException. Please help.

