import java
.io
.*
;
public class TestFileWriter {
public static void main(String
[] args
) {
File file
=new File("hello.txt");
FileWriter f
= null
;
try {
f
= new FileWriter(file
,true);
f
.write("我是小赵");
f
.write("我是小吴");
} catch (IOException e
) {
e
.printStackTrace();
}finally {
try {
if(f
!=null
) f
.close();
} catch (IOException e
) {
e
.printStackTrace();
}
}
}
}
转载请注明原文地址:https://tech.qufami.com/read-18616.html