Log in

View Full Version : PrintWriter object throws FileNotFoundException


koolguy251
Apr 2, 2013, 03:31 PM
I keep getting a FileNotFoundException when I input this code in netbeans. I created a "File" object with the location of a text file on my computer and it found it. But when I use that same "file" object as a location for a PrintWriter Object, I get a"FileNotFound Exception. Can anyone help me?

import java.io.*;



public class HW1Q3
{
File file = new File("C:\\Users\\koolguy251\\Documents\\Work\\CST4713\\h w1Notes.txt" );
PrintWriter out = new PrintWriter( file );