Does anyone know how to use Java to create sub-directories based on the alphabets (a-z) that is n levels deep?
/a
/a
/a
/b
/c
If you're using mkdirs() (as suggested by @Zhile Zou) and your File object is a file and not a directory, you can do the following:
// Create the directory structure
file.getParentFile().mkdirs();
// Create the file
file.createNewFile();
If you simply do file.mkdirs() it will create a folder with the name of the file.