File.mkdir()
This is a method of "File" class in Java and used to create a directory at specified path, it return true if directory creates or returns false if directory does not create.
Here, first of all we are creating an object name dir of "File" class by specifying the "directory name with the path (drive name)" and then we are using dir.mkdir() method to create directory (Here, dir is an object of "File" class).
Program to create directory in Java
Output