Home Tutorial Java Corejava How to make directory in java

 
 

Share on Google+Share on Google+
How to make directory in java
Posted on: April 12, 2010 at 12:00 AM
Advertisement
This tutorial demonstrate how to make directory at specified location. This example will make a directory.

Description:

This example demonstrate how to create a directory at specified path.

Code:

import java.io.File;

public class MakeDir {
  public static void main(String[] a) {
    File file1 = new File("c:\\newDir");
    file1.mkdirs();
  }
}

Output:

The result of this program is that it will make a dir at root directory of C drive.

Advertisement

Related Tags for How to make directory in java:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 12, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com