title: Java program can't create a file on c: disk
body: <p>The program works just fine if I replace the <code>c:</code> with <code>f:</code> which is my 2nd disk. Can someone explain why? </p>
  
  <pre><code>    import java.io.File;
      import java.io.IOException;
  
      public class create_document {
          public static void main(String args[]){
              try{
                  File file = new File("c:\\newfile.txt");
                  if(file.createNewFile()){
                      System.out.println("File is created!");
                  }else{
                      System.out.println("File already exists.");
                  }
              }   catch(IOException e){
                  e.printStackTrace();
              }
          }
      }
  </code></pre>
  
  <p>Exception:</p>
  
  <blockquote>
  <pre><code>   java.io.IOException: Access is denied
        at java.io.WinNTFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(File.java:1012)
        at create_document.main(create_document.java:12)
  </code></pre>
  </blockquote>