我遇到了组合数组值的问题。我想组合一个数组的两个值来为另一个数组创建一个值。这是我的代码:
String [] candid = {"A","B","C","D","E"};
String [] candidates = new String[candid.length];
for (int i=0;i<candid.length;i++){
candidates[i] = candid[i]+","+candid[i+1];
}
但是该命令candidates[i] = candid[i]+","+candid[i+1];
不起作用。