posts - 495,  comments - 11,  trackbacks - 0

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 阅读(91) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: