package com.zihan.org.file;
import java.io.FileWriter;
public class FileTest {
public FileTest() {
}
public static void main(String[] args) {
FileWriter fw = null;
try {
fw = new FileWriter("C:/add2.xml");
fw.write("你好,我是姚冬1120");
System.out.println("写入成功");
} catch (Exception e) {
e.printStackTrace();
}
finally {
try {
fw.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}