TestFileOut - } // Close file out.close(); // Now test the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// Test FileOut import chapman.io.*; public class TestFileOut { p // Define the main method public static void main(String arg[]) { double a[] = new double[10]; // Test open without append FileOut out = new FileOut("outfile"); // Check for valid open if ( out.writeStatus != out.IO_EXCEPTION ) { // Write values out.printf("double = %20.14f\n",Math.PI); out.printf("long = %20d\n",12345678901234L); out.printf("char = %20c\n",'A'); out.printf("String = %20s\n","This is a test.");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } // Close file out.close(); // Now test the append option out = new FileOut("outfile",true); // Check for valid open if ( out.writeStatus != out.IO_EXCEPTION ) { // Write values out.printf("double = %20.14f\n",Math.PI); out.printf("long = %20d\n",12345678901234L); out.printf("char = %20c\n",'A'); out.printf("String = %20s\n","This is a test."); } // Close file out.close(); } }...
View Full Document

This note was uploaded on 12/01/2010 for the course APPLIED SC 142 taught by Professor Professorstansimmons during the Winter '10 term at Queens University.

Ask a homework question - tutors are online