在JAVA中,这个数组哪里越界了?

[复制链接]
查看11 | 回复1 | 2011-4-1 03:52:44 | 显示全部楼层 |阅读模式
int[]sampleArrray=new int[10];
for (int index=1;index=sampleArray.length;index)
sampleArray[index]=3*index;
回复

使用道具 举报

千问 | 2011-4-1 03:52:44 | 显示全部楼层
<pre id=\"best-answer-content\" class=\"reply-text mb10\">sampleArrray 数组下标是0-9 怎么能等于10呢?应该把indexsampleArray,i有0开始
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行