import java.io.* ;
class FileWriterDemo3{
public static void main(String args[]){
FileWriter fw = null ;
try{
fw = new FileWriter("demo3.txt",true) ;//表示在有此文件时不会重建该文件并且输入的数据会进行续写
fw.write("fwfw") ;
}catch(IOException e){
System.out.println(e.toString()) ;
}finally{
try{
if(fw!=null){
fw.close() ;
}
}catch(IOException e){
System.out.println(e.toString()) ;
}
}
}
}
Java之FileWriter的续写
最新推荐文章于 2024-10-20 21:41:12 发布