ShareThis

Wednesday, December 14, 2011

How to create a folder in java code

This program will create a directory to the given path.

Java Code:
1
2
3
4
5
6
7
8
9
10
import java.io.File;
 
public class MakeDirectory {
 
    public static void main(String[] args) {
        File f = new File("c:\\MyFolder");
        f.mkdir();
 
    }
}

0 comments:

Post a Comment