这个是什么情况啊
aide吧
全部回复
仅看楼主
level 10
import java.util.*;
public class Main
{
public static void main(String[] args)
{
int b[]={12,13,14,15};
int a[]=new int [4];
for(int i=0;i<a.length;i++){
a[i]=b[i];
System.out.println("数组b"+i+"导入数组a");
}
for(int c=0;c<=a.length;c++){
System.out.print("数组a第"+c+"个数为"+a[c]);
}
}
}
2017年03月30日 01点03分 1
level 12
数组A越界了,应该是
for(int c=0;c<=a.length;c++){
System.out.print("数组a第"+c+"个数为"+a[c]);
}
2017年03月30日 03点03分 2
C<=A,的=去掉
2017年03月30日 03点03分
谢谢你啊,弄好了
2017年03月30日 06点03分
它为什么会越界呢
2017年03月30日 06点03分
@訣别詩_Poetry 数组下标从0开始计,数组个数从1开始计
2017年03月30日 16点03分
level 9
索引越界
2017年03月30日 03点03分 3
level 9
for(int c=0;c<a.length;c++){}
去掉=就好了
2017年03月30日 03点03分 4
谢谢你啊,搞定了
2017年03月30日 06点03分
level 7
2维数组就有点吃力,3维数组表示不要想[滑稽]
2017年03月30日 16点03分 6
他的是一位数组啊[笑眼]
2017年03月30日 16点03分
理解就好,做游戏多维数组会用得多点
2017年03月30日 16点03分
1