java字符输出如何让下一次循环输出到文件从第二行开始!??也就是不覆盖之前的数据!!!急急急
try{Strings=String.valueOf(ret);//ret在下一次循环的时候改变值了!!FileOutputStreamout=newFileOutput...
try{
String s=String.valueOf(ret);//ret在下一次循环的时候改变值了!!
FileOutputStream out = new FileOutputStream("D:\\match.txt");
OutputStreamWriter osw = new OutputStreamWriter(out, "utf-8");
BufferedWriter bwr = new BufferedWriter(osw);
bwr.write(s);
bwr.write('\n');
bwr.flush();
bwr.close();
}
catch(IOException e){ } 展开
String s=String.valueOf(ret);//ret在下一次循环的时候改变值了!!
FileOutputStream out = new FileOutputStream("D:\\match.txt");
OutputStreamWriter osw = new OutputStreamWriter(out, "utf-8");
BufferedWriter bwr = new BufferedWriter(osw);
bwr.write(s);
bwr.write('\n');
bwr.flush();
bwr.close();
}
catch(IOException e){ } 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询