IO:我的java筆記(2)

遇到的問題:
        in = new FileInputStream("");//這個是複製路徑
        out = new FileOutputStream("");//這個是目標路徑

在這兩個對象中: in, out, 關閉的時候也要捕獲IOException異常

這個注意。

        try
        {
        in.close();
        out.close();
        }
        catch(IOException e)
        {
            System.out.println("文件關閉錯誤");
            System.exit(-1);
        }


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章