阅读背景:

创建一个数组给了我java.lang.ArrayIndexOutOfBoundsException

来源:互联网 

I'm new to java, and I'm currently programming a pacman as a class project. The game is played on an array[8][8]; I've got to read a .txt file that includes walls, ghosts and their position in the array, and show them there. I've used Scanner, StringTokenizer and nextInt. When I compile the file, it doesn't give any errors, but when running it, java.lang.ArrayIndexOutOfBoundsException: 8 shows up; by the error name I can infer there's some object outside the array, but I can't seem to identify which one. Here's the code:I'm new to java, and I'm currently programming




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: