Writing Text Files
This chapter explains Java's FileWriter class and how you can use it to store data in files.
1. Writing Text Files
This chapter explains how to create a text file on the hard disk and how to write character data to it.
Chapter 21 used redirection to write text files. Redirection is when output that would normally go to the monitor is sent to a disk file. The program has no control of this.
In this chapter your program creates a file and writes output to it.
- Creating a disk file
- Closing a disk file
- Catching I/O exceptions
(Review: ) What is the ancestor class of all streams that do character-oriented output?
Source: Bradley Kjell, https://chortle.ccsu.edu/Java5/Notes/chap83/ch83_1.html
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 License.