Completion requirements
This chapter explains Java's FileWriter class and how you can use it to store data in files.
2. Writer
Answer:
Writer
Writer
Review: I/O streams are either character-oriented or byte-oriented. Character-oriented I/O streams have special features for handling character data. Byte-oriented I/O is for all types of data (including characters, if you want). This chapter shows character-oriented output to a disk file using a Writer
stream.
What class is used for writing characters to a file? You know that the class descends from Writer
. If you do not know what class you need, look under Writer
in the Java documentation.
(Recall that in these diagrams clouds show classes, dotted clouds show abstract classes, and arrows show inheritance.)
Question 2:
Does the class
FileWriter
seem like a likely candidate for writing characters to a file?