関数間を渡そうとしてList<String[]>
いますが、奇妙な結果が得られました。
関数!
public List<String[]> tes(){
List<String[]> test = new ArrayList<String[]>();
String[] temp = {"a","b","c"};
test.add(temp);
temp[0] = "d";
temp[1] = "e";
temp[2] = "f";
test.add(temp);
return test;
}
抽出。
String output = "";
List<String[]> Results = db.tes();
for (String[] row: Results) {
output = output + row[0] + " " + row[1] + "\n";
}
結果:
d e
d e
本当にわかりません。あるべきですがa b d e
、そうではありません。