/*
    Introduction to OOP with Java (5th Ed), McGraw-Hill

    Wu/Otani

    Chapter 12 Sample Program: Illustrate the use of PrintWriter

    File: Ch12PrintWriterV2.java
*/

import java.io.*;

class Ch12TestPrintWriterV2 {

   public static void main (String[] args) throws IOException {

      //setup file and stream
      FileOutputStream  outFileStream = new FileOutputStream("sample3.data");
      PrintWriter       outStream     = new PrintWriter(outFileStream);

      //write values of primitive data types to the stream
      outStream.println(987654321);
      outStream.println(11111111L);
      outStream.println(22222222F);
      outStream.println(3333333D);
      outStream.println('A');
      outStream.println(true);

      //output done, so close the stream
      outStream.close();
   }
}

