writeFile - } catch (SecurityException e) {

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

View Full Document Right Arrow Icon
import java.io.*; import java.util.*; public class writeFile { public writeFile() { String filename="thisisthefile.txt"; File file = new File(filename); try { BufferedWriter output = new BufferedWriter(new FileWriter(file)); output.write("Hello there"); output.close(); System.out.println("File " + filename + " written");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } catch (SecurityException e) { System.err.println("writeFile: caught security exception"); } catch (IOException e) { System.err.println("writeFile: caught IO exception"); } } public static void main(String args) { writeFile wf = new writeFile(); } }...
View Full Document

This note was uploaded on 07/14/2011 for the course COP 4610L taught by Professor Staff during the Spring '09 term at University of Central Florida.

Ask a homework question - tutors are online