how to create New file with specified file extension ?
hi,
here is the code that can able to create new file in my desired folder. Now what should i do if want to separate the file extension while using createNewFile() method ?
Code:
try{
File directory = new File("C:/Java/mydir");
directory.mkdirs();
File f = new File(directory, "info.txt");
f.createNewFile();
}
suppose, to create temp file, it has a method to separate the file extension.
Code:
File file = File .createTempFile( "info", ".txt", new File( "C:\\Java" ) );
have any method like this for createNewFile() method ??