Preloader image
DDD

자바

간단하지만 외우지 않는 디렉토리 생성 - Directory Create

작성자 관리자 (admin)
조회수 1,403
입력일 2021-05-11 23:31:19

import java.io.File;

public class CreateDir 
{
  public static void main(String[] args)
  {
    String dirStr = "c:/temp/hello3";
    File createDir = new File(dirStr);
    if(createDir.mkdir()){
      System.out.println("디렉토리를 생성했습니다.");
    }else{
      System.out.println("디렉토리를 생성하지 못했습니다.");
    }
  }
}

^