The buffered output construct in the previous foil is of limited use since BufferedWriter has so few output methods. Instead, use the "monster" chain: |
PrintWriter out =
|
which can be shortened somewhat by using FileWriter as shown earlier. |
The PrintWriter class defines print(...) and println(...) methods for all primitive types, which unlike other Reader/Writer classes never throw exceptions. |