DEV Community

skptricks
skptricks

Posted on

How to create directory in Java

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

Top comments (1)

Collapse
 
jodyshop profile image
Waleed Barakat

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