I'm trying to create a Java program to create and write a text file, but : <pre><code>public static void main(String[] args) {
    File newTxt = new File("C:/Users/cauan/Desktop/newTxt.txt");

    if(newTxt.exists()) System.out.println("The file already exists!");
    else {
        try{ 
            newTxt.createNewFile();
            FileWriter fw=new FileWriter(newTxt);
            BufferedWriter bw = new BufferedWriter(fw);

            bw.write("This is my Prog");
        }
        catch(Exception e){e.printStackTrace();}
    }        
} 
</code></pre>

<p>This is my code.... But i dunno why am i getting an error :/</p>
