import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; public class HDFSExample { public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(conf); Path path = new Path("/myDirectory"); // Set the path for the new directory boolean result = fs.mkdirs(path); // Create the new directory System.out.println("Directory created: " + result); } }This example code first creates a Configuration object to specify the configuration to use for the FileSystem. Then, it creates a FileSystem object using the get() method and passes in the Configuration. Next, it creates a new Path representing the directory to be created. Finally, it calls the mkdirs() method on the FileSystem object passing in the Path and stores the result in a boolean variable. Package Library: The package library used is org.apache.hadoop.fs which is part of the Hadoop Core library.