StringBuffer sb = new StringBuffer();
for (int i = 0; i < a.length; i++) {
sb.append(String.valueOf(a[i]));
}
t[1].setText(sb.toString());
不是很明白你的意思,你的标题和代码有什么关系吗?要在setText中追加内容的话,直接:setText(getText+新内容)不就行了
String sb = new StringBuffer();
for(int i = 0 ; i < a.length;i++)
sb.append(String.valueOf(a[i])).append(" ");
sb.deleteCharAt(sb.length()-1);
File filename = new File("d:/test.txt");
if (!filename.exists())
filename.createNewFile();
FileWriter fileWriter = new FileWriter("d:/test.txt", true); // true代表追加
fileWriter.write(sb.toString());
fileWriter.flush();
fileWriter.close();