File Creation


public class FileCreation {

    public static void main(String[] argsthrows IOException {
        File f = new File("D://file3.txt");
        f.createNewFile();                              // Creates new file
        if (f.exists()) {                                        
            System.out.println("File created successfully..!!");
        else {
            System.out.println("No file is created");
        }
    }
}

Output:
File created successfully..!!