카테고리 없음

[java] File Class 의 mkdir() 과 mkdirs() 차이

윤보람 2010. 3. 12. 12:33

실제 폴더 구조 C:\nayun\

File file = new File("C:\\nayun\\parent\child");
file.mkdir();   // false 파일미생성
file.mkdirs();  // true 파일생성

 boolean mkdir()
          Creates the directory named by this abstract pathname.
 boolean mkdirs()
          Creates the directory named by this abstract pathname, including any necessary but nonexistent parent directories.


개발자는 역시 자신의 주 언어를 할 때가 가장 편안하고 행복하다.
경험을 통해, API 를 통해 앎의 깊이가 깊어질 때 가장 행복하다.