Jeff Verdegan wrote:Also, don't just print getRowSize(). You need to print out all of these
I can't say I much like variables named X and ZZ either.
Jeff Verdegan wrote:That's an awful lot of code to read, so I'm not even going to try.
If you're getting an AIOOBE after 4 iterations on a length-8 array, then you're probably incrementing twice for each iteration. At the very least, you're incrementing more often of by a larger amount than you think.
So just before the line that's giving the exception, add a println() statement that shows you the length of the array and the index you're about to access. And then you may want to go add println()s everywhere you increment that index and print the before and after.