java - mkdir() is not creating the new directory -


i using eclipse , jdk1.7. making basic program using file handling, in output directory inside directory made. when run program, output showing false , directory not made. thought output false because of presence of directory same name, not reason. need help. here code:

import java.io.file;  public class p {     public static void main(string[] args) {         file f1 = new file ("abc");         file f2 = new file (f1,"abc");         system.out.println(f2.mkdir());     } } 

its output false , yet no directory has been created. how can resolve problem? not in program - each , every program in calling method mkdir() having same problem.

you have use mkdirs() s if want create multiple directories. worth checking canwrite() location places permissioned. both of these on file class


Comments