|
Say that you want the processing that OutputStreamWriter performs. Will you get this with a FileWriter? A good answer might be:Yes, since FileWriter inherits from OutputStreamWriter. |
Example ProgramThe example program constructs a FileWriter stream. This also creates a disk file in the current directory, named "reaper.txt". The write() method is called several times to write characters to the disk file. Then the file is closed.
Details will be explained in a bit. For now, copy-paste-save-and-run this program. Note: each time you run the program it will delete any existing file named "reaper.txt" and create a new one. You might wish to check that the 20 page report that you wrote last night is not saved in "reaper.txt". |
QUESTION 4:After you run the program, how can you confirm that it created a new file? Click Here after you have answered the question |