Java examples for File Path IO:File Operation
Creating a File
import java.io.File; import java.io.IOException; public class Main { public void m() { try {/*from ww w . j a va 2 s .c om*/ File file = new File("filename"); // Create file if it does not exist boolean success = file.createNewFile(); if (success) { // File did not exist and was created } else { // File already exists } } catch (IOException e) { } } }