Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Java (https://www.askmehelpdesk.com/forumdisplay.php?f=440)
-   -   PrintWriter object throws FileNotFoundException (https://www.askmehelpdesk.com/showthread.php?t=742316)

  • Apr 2, 2013, 03:31 PM
    koolguy251
    PrintWriter object throws FileNotFoundException
    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\\CST4 713\\hw1Notes.txt" );
    PrintWriter out = new PrintWriter( file );

  • All times are GMT -7. The time now is 09:13 PM.