Create new directories

ReturnMethodSummary
booleanmkdir()Creates the directory named by this abstract pathname.
booleanmkdirs()Creates the directory named by this abstract pathname, including any necessary but nonexistent parent directories.

import java.io.File;

public class Main {

  public static void main(String[] args) {
    File file = new File("c:/abc");
    System.out.println(file.mkdir());
    
    file = new File("c:/a/b/c");
    System.out.println(file.mkdirs());
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.