create File - Java File Path IO

Java examples for File Path IO:File Operation

Description

create File

Demo Code


//package com.java2s;

import java.io.File;

import java.io.IOException;

public class Main {
    public static boolean createFile(File file) {
        if (file == null)
            return false;
        try {/*from   w  w  w.  ja va  2s  . c  o  m*/
            return file.createNewFile();
        } catch (IOException e) {
            return false;
        }
    }
}

Related Tutorials