Java程序出现错误 数组越界 (刚学不久,不知道哪里错了,求大神指导!!!)

public class Score{
public static void main(String[] args){
int[][] score=new int[][]{{88,90,90},{70,60,70},{54,88,50},{60,75,83}};
double ave1[]=new double[4];

for(int i=0;i<4;i++){
   for(int j=0;j<3;i++){
            ave1[i]+=score[i][j];
   }

      System.out.println(ave1[i]/3+" ");
   }

double ave2[]=new double[3];

for(int n=0;n<3;n++){
   for(int m=0;m<4;m++){
        ave2[n]+=score[m][n];
 } 

System.out.println(ave2[n]/4+" ");
   }

}

}

//出现这样的错误 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
at Score.main(Score.java:8)

0
扫码支付0.1元 ×