@Test
//将内容写入文件
public void xieru() throws Exception{
FileWriter fileWriter=new FileWriter("d:\\Result.txt");
int [] a=new int[]{111,222,333,444,555,666};
for (int i = 0; i < a.length; i++) {
fileWriter.write(String.valueOf(a[i])+"\n");//换行转意
}
fileWriter.flush();
fileWriter.close();
}
时间: 2024-10-11 07:34:30