File Mkdir() Example
Creates the directory named by this abstract pathname.
File class Mkdir() method example. This example shows you how to use Mkdir method.This method Creates the directory named by this abstract pathname.
Here is the code:-
/**
* @Program that Creates the directory named by this abstract pathname.
* Mkdir.java
* Author:-RoseIndia Team
* Date:-30-May-2008
*/
import java.io.*;
public class Mkdir {
public static void main(String[] args) {
File f = new File("/home/girish/Desktop/girish");
// Creates the directory
boolean b = f.mkdir();
System.out.println("Creates the directory : " + b);
}
} |
Output of the Program
| Creates the directory : true |
|