I know how to create a new folder, but i don't know how to way to create an another new folder into a new folder i just created
String y="C:/TEMP/Four Area";
File file=new File(y);
if(file.mkdir()){
System.out.println("file is created");
}else{
System.out.println("file is created");
}
But what i want is "C://TEMP/Four Area/New Area", i want system to create "New Area" folder into "Four Area" folder in above code. I tried to use String y="C://TEMP/Four Area/New Area
, it won't create any folder
use file.mkdirs()
instead to create multiple nested directories
Creates the directory named by this abstract pathname, including any necessary but nonexistent parent directories. Note that if this operation fails it may have succeeded in creating some of the necessary parent directories.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.