我正在尝试将数组中的条目复制questionLineFields
到一个名为testQuestions
.
我试图复制索引 [1 到 3] 而questionLineFields
不是 [0] 索引的值。
这是我当前的代码:
String[] A = new String[3];
String[] B = new String[]{"3","T","F","T"};
for(int i=0;i<3;i++){
A[i] = B[i+1];
}
这不起作用,我收到一个ArrayIndexOutOfBoundsException
. 我见过这个线程。我最好使用 for 循环,因为我的教授要求使用 for 循环。
谢谢!