This code demonstrates how to create a directory using the File class in Java. The program creates a directory named "Sample" in the "D:" drive of the computer. Here is a step-by-step explanation of the code:
Overall, this code is a simple example of how to create a directory in Java using the File class.
import java.io.*; public class Create_Directory { public static void main(String[] args) { File dir = new File("D:/Sample"); boolean isDirectoryCreated = dir.mkdir(); if (isDirectoryCreated) { System.out.println("Directory Successfully Created.." ); } else { System.out.println("Directory was Not Created Successfully.."); } } }
Directory Successfully Created..
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions