how to create a new directory in java code example Example: java create folder new File("pathToFile").mkdir();