best to use java mkdir

Solutions on MaxInterview for best to use java mkdir by the best coders in the world

showing results for - "best to use java mkdir"
Finley
06 Feb 2018
1import java.io.File;
2
3// demonstrates how to create a directory in java
4public class JavaCreateDirectoryExample
5{
6  public static void main(String[] args)
7  {
8    File dir = new File("/Users/al/tmp/TestDirectory");
9    
10    // attempt to create the directory here
11    boolean successful = dir.mkdir();
12    if (successful)
13    {
14      // creating the directory succeeded
15      System.out.println("directory was created successfully");
16    }
17    else
18    {
19      // creating the directory failed
20      System.out.println("failed trying to create the directory");
21    }
22  }
23}
24
queries leading to this page
mkdirs for javabest to use java mkdir