(ottobonn) program throws java.lang.ArrayIndexOutOfBoundsException

Help! When I try to run this program (which compiles fine), I get the java.lang.ArrayIndexOutOfBoundsException at NumFactorer.main (NumFactorer.java:19). This is a simple program called NumFactorer which finds the factors of a positive integer "number", and then stores them in the array "ResultArray". I'm new to java and I can't figure out how to fix it. Below is my code. Please, if you have suggestions, post them.

class NumFactorer {

public static void main (String arguments[]){

int divisor = 1;

int number = 9;

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]);

}

}

[938 byte] By [Ottobonna] at [2007-11-26 21:57:48]
# 1
MULTIPOST: http://forum.java.sun.com/thread.jspa?threadID=5138232
DrLaszloJamfa at 2007-7-10 3:55:19 > top of Java-index,Java Essentials,New To Java...