【发布时间】:2010-08-05 21:32:54
【问题描述】:
我不知道为什么会生成 ArrayOutOfBoundsException!很可能我忽略了一些东西,因为我太累了,但如果有人能告诉我出了什么问题,我会很感激的。谢谢。
// array declaration
public int CircleLeft[] = new int[mIPAWidth];
// this is my loop that generates the error:
for(px = 0; px <= mIPAWidth - 1; px++){
py =(int) m.sqrt(r^2 - (px-mIPAWidthHalf)^2) + mIPAHeightHalf;
Log.w(getClass().getName(), "mIPAWidth = " + mIPAWidth + ", index is: " + px);
CircleLeft[px] = py; }
【问题讨论】: