import java.io.*;
public class ToFile
{
public static void main(String[] args)
{
?? try
?? {
??? String filename = "out.txt";
??? BufferedWriter bw = new BufferedWriter(new FileWriter(filename));
??? bw.write("Hello,China!");
??? bw.write("\n");
??? bw.write("Hello,World!");
??? bw.close();
?? }
?? catch(IOException e)
?? {
??? System.out.println("IOException");
??? e.printStackTrace();
?? }
}
}
posted on 2007-10-08 21:45
jadmin 閱讀(92)
評論(0) 編輯 收藏