user364669 user364669 - 1 month ago 7
Java Question

How to create a folder in Java?

How can I create an empty folder in Java?

Answer
File f = new File("C:\\TEST");
try{
    if(f.mkdir()) { 
        System.out.println("Directory Created");
    } else {
        System.out.println("Directory is not created");
    }
} catch(Exception e){
    e.printStackTrace();
} 
Comments