查询元素
获取Index索引位置元素
int get(int Index){
if(Index<0 ||Index>=0)
throw new IllegalArgumentException("get failed,Index is illegal.");
return data[Index];
}
修改元素
void set(int Index, int e){
if(Index<0 ||Index>=size)
throw new IllegallArgumentException("set failed,Index is illegal.")
data[Index] = e;
}
博客主要围绕数组展开,介绍了数组元素的相关操作,包括查询元素,获取指定Index索引位置的元素,以及对元素进行修改等信息技术相关内容。

被折叠的 条评论
为什么被折叠?



