FileWriter

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page        

Answer:

Yes.

FileWriter

Class FileWriter is used for output of character data to a disk file. Here is where it is in the hierarchy of Writer classes:

writer hierarchy

The arrows in this diagram show inheritance. A FileWriter is a kind of OutputStreamWriter, which is a kind of Writer, which is a kind of Object. When you read Java documentation, you might need to look at several ancestors of a class you are interested in.

QUESTION 3:

Say that OutputStreamWriter has several methods you would like to use. Will a FileWriter object have these methods?