异常名称:数组越界
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
at Domo.main(Domo.java:8)
案例:
int[] scores =new int[2];
scores[0]=90;
scores[1]=85;
scores[2]=65;
出现原因:超出数组数量
解决方案:数组长度重新定义
异常名称:数组越界
猜你喜欢
转载自www.cnblogs.com/zzh630/p/10223228.html
今日推荐
周排行