2009年9月3日 星期四

Java FileWriter 開啟 append 功能

API:http://java.sun.com/javase/6/docs/api/java/io/FileWriter.html
範例文章:http://carrybetter.pixnet.net/blog/post/22039594

FileWriter(String fileName, boolean append)
Constructs a FileWriter object given a file name with a boolean indicating whether or not to append the data written.

##ShowAll##
就想說我已經用append()去寫入了,為什麼還是覆蓋掉前面的資料...原來還要給一個true的參數

沒有留言:

張貼留言