adsense


Showing posts with label JAVA EXAMPLES CREATE DIRECTORIES RECURSIVELY. Show all posts
Showing posts with label JAVA EXAMPLES CREATE DIRECTORIES RECURSIVELY. Show all posts

Tuesday, 27 October 2015

JAVA EXAMPLES CREATE DIRECTORIES RECURSIVELY PAGE 102

COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button



JAVA EXAMPLES CREATE DIRECTORIES RECURSIVELY





Java Examples - Create directories recursively


Problem Description:
How to create directories recursively ?
Solution:
Following example shows how to create directories recursively with the help of file.mkdirs() methods of File class.
import java.io.File;

public class Main {
   public static void main(String[] args) {
      String directories = "D:\\a\\b\\c\\d\\e\\f\\g\\h\\i";
      File file = new File(directories);
      boolean result = file.mkdirs();
      System.out.println("Status = " + result);
   }
}
Result:
The above code sample will produce the following result.
Status = true