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)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 信阳市| 江口县| 盐边县| 吉木萨尔县| 澎湖县| 江西省| 襄垣县| 珠海市| 临桂县| 建水县| 昂仁县| 商都县| 临江市| 托克托县| 邯郸市| 淮北市| 古交市| 甘谷县| 乌鲁木齐市| 广河县| 岳池县| 兰溪市| 金平| 资源县| 翼城县| 陕西省| 公主岭市| 墨竹工卡县| 淮滨县| 江城| 嘉兴市| 那曲县| 孙吴县| 鹤壁市| 抚顺市| 柳州市| 衡山县| 醴陵市| 防城港市| 南岸区| 丹巴县|