file writer doesn't work

后端 未结 5 446
野性不改
野性不改 2020-12-19 14:28

I use a FileWriter and a BufferWriter to write in a file. The file \"test.txt\" is created but nothing is written inside.

The file should be written in the ActionEve

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-19 15:08

    you have to flush your writer.

    out.flush();
    out.close();
    

    put these two lines after all writing is done to close the file

提交回复
热议问题