How To Create New File

import java.io.*;

public class CreateFile{
  public static void main(String[] args) throws IOException{
  File f;
  f=new File(“myfile.txt”);
  if(!f.exists()){
  f.createNewFile();
  System.out.println(“New file “myfile.txt” has been created
  to the current directory”);
  }
  }
}

(Visited 24 times, 1 visits today)

Lascia un commento

Il tuo indirizzo email non sarà pubblicato.