posts - 495,  comments - 11,  trackbacks - 0


          import java.io.*;

          public class FileWriterTest
          {
          public static void main(String[] args)
          {
          ?? FileWriterTest t = new FileWriterTest();
          ?? t.WriteMyFile();
          }

          void WriteMyFile()
          {
          ?? try
          ?? {
          ??? FileWriter fw = new FileWriter("mydata.txt");
          ??? PrintWriter out =new PrintWriter(fw);
          ??? out.print("Hello,World!");
          ??? out.close();
          ??? fw.close();
          ?? }
          ?? catch(IOException e)
          ?? {
          ??? System.out.println("OH,got an IOException error!");
          ??? e.printStackTrace();
          ?? }
          }
          }

          posted on 2007-05-28 00:28 jadmin 閱讀(52) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 大渡口区| 孟津县| 赤城县| 广德县| 辉南县| 伽师县| 农安县| 巢湖市| 贡嘎县| 伊通| 望奎县| 汤阴县| 咸宁市| 白玉县| 库尔勒市| 西乌| 琼结县| 平塘县| 伊川县| 宾阳县| 莒南县| 扎赉特旗| 阿拉尔市| 通道| 慈利县| 樟树市| 卓资县| 海南省| 无锡市| 成都市| 南昌县| 宕昌县| 马鞍山市| 洛川县| 惠州市| 色达县| 福海县| 大埔区| 屯留县| 喀喇沁旗| 繁峙县|