title: using File class to create new text file
body: <p>Is there a way to use the File class to create a new text file?  After doing some research, I tried:</p>
  
  <pre><code>import java.io.*;
  
  public class createNewFile
  {
      public static void main(String args[]) throws IOException
      {
          File file = new File("newfile.txt");
          boolean b1 = file.createNewFile();
      }
  }
  </code></pre>
  
  <p>...but there is still no <i>newfile.txt</i> in my source directory.  It would also seem like there would be a void method to do this, instead of having to result to a boolean.  Is there a way to do what I'm trying to do with the FIle class, or so I have to result to another class?</p>