FileWrite - { outFile.close(); //once the file has been...

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

View Full Document Right Arrow Icon
/** * Jesus Campos * CS-116-004 * Final Project - File Write Class * The FileWrite class allows the user to write the data on a file. **/ package code2; p import*; public class FileWrite { p BufferedWriter outFile; public FileWrite(String outFile1) throws IOException p { outFile = new BufferedWriter(new FileWriter(outFile1)); //the user is allowed to specified the name of the file to be created } public void close() throws IOException
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { outFile.close(); //once the file has been written, it must be closed. This method allows for the file to be closed. } public void writeToObject(String s) throws IOException { outFile.write(s); //this is the method that makes the writing to the file. It takes a string as an argument and writes it to a line. outFile.newLine(); //it then moves to a new line where more data is to be written. } }...
View Full Document

This note was uploaded on 06/18/2009 for the course CS 116 taught by Professor Theys during the Spring '07 term at Central Texas College.

Ask a homework question - tutors are online