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