Create New file

There are 3 ways to create a new file in Java 1) Using java.io.File.createNewFile() method 2) Using java.io.FileOutputStream class 3) Using java.nio.file.Files from NIO API 1) Using java.io.File.createNewFile() method File file = new File("C:\\newfile1.txt");   //Creates new file and return true if file not exists and return false if file already exists boolean fvar = […]

Share this article on