Answers for "what do we use to create folders in java"

1

How to create directory in java

// mkdir() method in java example
import java.io.*;
public class CreateDirectory
{
   public static void main(String[] args)
   {
      File directory = new File("D:\\DirectoryExample");
      if(!directory.exists())
      {
         if(directory.mkdir())
         {
            System.out.println("Directory is created");
         }
         else
         {
            System.out.println("Directory not created");
         }
      }
   }
}
Posted by: Guest on December-01-2020
0

how to create folder java

Path path = Paths.get("/home/mkyong/a/b/c/");

    //java.nio.file.Files;
    Files.createDirectories(path);
Posted by: Guest on April-23-2021

Code answers related to "what do we use to create folders in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language