Java write strings to file 2 create a reusable method

preview_player
Показать описание
Create a method that writes strings to a file.
Рекомендации по теме
Комментарии
Автор

I'm getting the address and not the data from an object. I do have a toString() method. But it doesnt appear to be working.

Kephers
Автор

Hello Shad, hello from Australia. Firstly, let me say that I love your videos. I enjoy them greatly. Secondly, I would like to humbly point out an issue with the code in this video. In the method declaration you have as parameters (String fileName, String text, boolean append). In your code resuable method you do not test anywhere to see if append is true or false. You have added the 'append' parameter to the FileWriter object fw and based on the current code, this works - but as a test case try setting all 'saveToFile" calls to false in the main method to see if you can overwrite the file 2 times. Anyway, sorry for pointing out the obvious. Best regards, Darren

darrensmith
join shbcf.ru