Quote:
|
Originally Posted by finittz
int table[] [] = new int [a] [b]; // max for table
for (int row = 1 ; row <= a ; row++) //length of rows
{
for (int col = 1 ; col <= b ; col++) //length of columns
{
|
ArrayIndexOutOfBoundsException indicates that the array index (the number representing the element you're trying to interact with) is outside of the element indices in the array.
From a quick inspection, you should be using the less than operator rather than the less than or equal to operator in your for statements. The reason for this is that array indices start at zero while the variables a and b specify the number of elements in the array and hence will be one larger than the highest array index.