How to create a directory in Java?

new File("/path/directory").mkdirs();

Here “directory” is the name of the directory you want to create/exist.

Leave a Comment