我定义的一个类中
public abstract class AbstractSolid extends MainFrame implements MouseListener,
KeyListener {
protected NewClock clock;
// 计算分值的数组,按照计算的步骤和对应的分值,形成。
protected double avgtime; protected double time; protected double wideget; protected String sql = "insert into "; protected  int[] values = { 2526, 2526, 2165, 2165, 1804, 1804, 1443,
1443, 1082, 1082, 721, 721, 360 };//定一的int数组 protected ImageProducter product; protected boolean advance; // 是否进入第二环节,否表示第一环节 protected int step = 0; // 当前步骤值 protected int errorStep = 0; // 错误步骤值 protected int firsterrorNumbers = 0; // 第一个步骤的错误次数 protected int nexterrorNumbers = 0; // 错误次数 protected int score; // 得分值
protected int totalstep=0;
protected InnerPanel ip; abstract protected void update(); // 计算分值
public void caculateScore() {
// 如果是前一个步骤

if (!advance) {
if(totalstep==16&&(firsterrorNumbers==0||firsterrorNumbers==1)){
score=180;
return;
}
if (totalstep > 3)
score = values[totalstep - 4];//???系统报错的地方
else
score = 0;
} else { // 如果是后一个步骤
// 如果前一个步骤只有一个或者没有错误
if (firsterrorNumbers == 0 || firsterrorNumbers == 1) {
// 如果第二步骤的第六步前只有一个错误

if (totalstep == 6) {
score = 60;
}
// 如果是第一到第三步
if (totalstep > 1 && totalstep < 4) {
score = 240;
}
// 如果是第四到第五步
if (totalstep > 3 && totalstep < 6)
score = 120;
}
}
}
}
当我在其他地方调用caculateScore() 方法时系统报java.lang.ArrayIndexOutOfBoundsException :13
麻烦大家看看,在线等!!!!!!