DEV Community


How to create directory in Java

skptricks profile image skptricks ・1 min read

Post Link : How to create directory in Java

To create a directory in Java, just use the mkdir or mkdirs methods of the Java File class. you can see in below example, both methods (mkdir and mkdirs) return a boolean value indicating whether the directories were created successfully. You'll want to include your own logic in the if/then tests that are shown after the mkdir and mkdirs method calls.

Click to view source code

Discussion (1)

Editor guide
jodyshop profile image
Waleed Barakat

This is what I waiting for so long! Thank you :)