I'm getting an "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1" on line 33 and I can't figure out what the deal is...any ideas?
Printable View
I'm getting an "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1" on line 33 and I can't figure out what the deal is...any ideas?
Because you defined your 2d array as only having a single element in the first dimension and you are trying to do things with a second element along that dimension. That first "1" in your declaration of c25k means it only has one element in that dimension (i.e. only c[0][x]), it does not denote the highest index. If you want a second element (i.e. c[i][x]), you need a 2 in that position of your declaration, of course.
Whew, it's amazing what lack of sleep does...Thank you!