【发布时间】:2014-05-26 19:15:28
【问题描述】:
我正在尝试使用此 void 方法将一些元素添加到数组中;
if (count == numbers.length) {
int[] temp = new int[count+1];
for(int a = 0; a<count; a++)
temp[a] = numbers[a];
numbers = temp;
numbers[count] = (x);
count++;
它没有添加。感谢您的关注。
【问题讨论】:
-
您的循环是否正确实施?在您的代码中似乎没有看到循环块 {}。