Here are the two methods to create a directory in Java:
Method 1:
new File("/path/directory").mkdirs();
In this, "directory" represents the name of the directory you want to create/exist.
Method 2:
You can use FileUtils.forceMkdir
FileUtils.forceMkdir("/path/directory");
If you want to learn Java, you can register for this Java Course by Intellipaat.