//----------------------------------------------------覆蓋原有
import java.io.*;
public class A{
public static void main(String [] args) throws Exception{
FileWriter fw = new FileWriter("gg.txt");
fw.write("你好!!");
fw.close();
}
}
//---------------------------------------------------加在尾端
import java.io.*;
public class A{
public static void main(String [] args) throws Exception{
FileWriter fw = new FileWriter("gg.txt", true);
fw.write("你好!!");
fw.close();
}
}
全站熱搜
留言列表