把String內容輸出到Txt文件裡

String str = "hello world";
                try {
                    FileWriter fw = new FileWriter(PATH + "/aa.txt");
                    fw.flush();
                    fw.write(str);
                    fw.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }

 

摘自 oldfeel

發佈留言