package Test;
import java.io.*;
public class Test {
public static void main(String args[]){
// InputStream is=null;
Writer fw=null ;
BufferedWriter w=null;
try {
//InputStream is=new FileInputStream("");
fw=new FileWriter("C:\\Test.txt");
w=new BufferedWriter(fw);
w.write("9999999");
w.write("\n"); //不会读入,是否换行不是这样决定的 ,而是由文件格式决定的
w.flush();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
System.out.println("error2");
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("error1");
e.printStackTrace();
}finally{
try {
fw.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}