go to previous page   go to home page   go to next page

Answer:

Writer


Writer

I/O hierarchy

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?