English 中文(简体)
多层次的阿雷拉和阿雷拉内德韦特奥菲博
原标题:Multi-Dimensional Array and ArrayIndexOutOfBoundsException
  • 时间:2010-03-23 17:52:33
  •  标签:
  • java
  • arrays

我有奇怪的问题,我可以确定:

领域:

private boolean[][][] gaps;

司机(第1行):

gaps = new boolean[NOBARRICADES][WIDTH][HEIGHT];

司机(2线):

for (int i = 0; i < NOBARRICADES; i++) {

Java对第2行投了一个错误,说:

thread “main”java.lang. Arf

是否与 Javayn辛(错误属于这些法典的范畴)有任何关系? 或者,我应该把问题放在其他地方?

最佳回答

你也许会错过错误产出。 你的第二行甚至无法进入阵列——确保它不会成为排他性的排行的第一线。 此外,确保你只使用<代码>i,以指数表示贵国阵列的第一尺寸。

问题回答

有时,java汇编者被一线或两条截断。 您可以检查一下行文上的编码线,指出错误已经发生,看看看看看看看什么。

但你确实不想这样做。

多功能阵列从来不值得混淆,它们造成的混淆毫无积极价值(只有POSSIBLE例外,有清晰、明显的xy阵列)。

我建议你从两个维阵列清单或每个物体包含清单的两维阵列开始。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签