import java.io.BufferedWriter;
import java.io.IOException;
public class FileWriter {
public static void main(String[] args) {
try {
String fpath = "D:/abc/test.txt";
BufferedWriter fout = new BufferedWriter(new FileWriter(fpath));
fout.write("花花世界看看世界");
fout.newLine();
fout.close();
System.out.println("写档完成");
}catch (IOException e) {
e.printStackTrace();
}
}
}
BufferedWriter fout = new BufferedWriter(new FileWriter(fpath))
这行出错误了 是版本问题吗? 还是少了什么???