Java write to file. Using a loop

后端 未结 6 1691
不知归路
不知归路 2021-01-25 00:53

I have a simple application that yet would trash a text file (it\'s just practice) I\'m only 3 days with Java yet. Problem is there are no errors until you run the program then

6条回答
  •  滥情空心
    2021-01-25 01:45

    Only close your FileWriter stream once you are completely done using it.

    Also, the write method for FileWriter does not include a method for only a String parameter. That might be the garbage you are getting when reading the file.

提交回复
热议问题