java directory creation

Use the mkdir method of the File class to create the directory

public class fileClass{
	public fileClass() throws IOException{
		
		File dir = new File("/Users/Shared/java/");
 
		//Create a directory using mkdir
		dir.mkdir();
	}
}

In the above sample code, a directory is created with an absolute path in an instance of the File class, and it is created with the mkdir method.

When you create a file, it will not be created even if it has already been created.

Recommended Posts

java directory creation
Eclipse ~ Java project creation ~
Java Discord Bot creation
[Java] Calculator program creation 1
Java multi-project creation with Gradle
[Java] Creation of original annotation
Java
Arbitrary string creation code by Java
[Java] Reference / update of Active Directory
Java learning (0)
Studying Java ―― 3
[Java] array
[Java] Annotation
[Java] Module
Java array
Java tips, tips
Java methods
Java method
java (constructor)
Java array
[Java] ArrayDeque
java (override)
java (method)
Java Day 2018
java (array)
Java static
Java serialization
JAVA paid
Java (set)
java shellsort
Studying Java -5
java reflexes
java (interface)
Java memorandum
Memo: [Java] Check the contents of the directory
☾ Java / Collection
Studying Java ―― 1
[Java] Array
[Java] Polymorphism
Studying Java # 0
Java review
java framework
Java features
Java features
java beginner 3
Java memo
java (encapsulation)
Java inheritance
[Java] Overload
Java basics
Decompile Java
[Java] Annotation
java notes
java beginner
Java (add2)
JAVA (Map)
[java] interface
[Java] How to get the current directory
Java basics
Java methods
Java diary