File file = new File(".");

String path = file.getCanonicalPath();

String fs = System.getProperty("file.separator");

String fileName = path + fs + "myFile.txt";

FileWriter fileWriter = new FileWriter(fileName, true);

fileWriter.append(str);

fileWriter.close();

 

File (Java 2 Platform SE 5_0)

System (Java 2 Platform SE 5_0)

FileWriter (Java 2 Platform SE 5_0)

 

arrow
arrow
    全站熱搜

    fabch2 發表在 痞客邦 留言(0) 人氣()