
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a Directory recursively using Java?
The java.io.File.mkdirs() creates the directory named by this abstract pathname, together with necessary and non-existent parent directories.
Example
import java.io.File; public class Main { public static void main(String[] args) { String directories = "D:\\a\\b\\c\\d "; File file = new File(directories); boolean result = file.mkdirs(); System.out.println("Status = " + result); } }
Output
Status = true
- Related Questions & Answers
- How to create a directory recursively using Python?
- How to remove a directory recursively using Python?
- How to create a directory using Java?
- How to create a directory hierarchy using Java?
- Java program to List all files in a directory recursively
- How to scan through a directory recursively in Python?
- How to create a directory using Python?
- How to create a Directory using C#?
- How to create a directory in project folder using Java?
- Create directories recursively in Java
- Create a directory in Java
- How to create a new directory by using File object in Java?
- How to create a unique directory name using Python?
- Java program to delete all the files in a directory recursively (only files)
- How to create a zip archive of a directory using Python?
Advertisements