Unverified Commit 5c2e5c3b authored by Lokesh Singh's avatar Lokesh Singh Committed by GitHub

Create createFIle.java

parent 7d83534b
import java.io.File;
class createFile {
public static void main(String[] args) {
File file = new File("newFile.txt");
try {
boolean value = file.createNewFile();
if (value) {
System.out.println("The new file is created.");
}
else {
System.out.println("The file already exists.");
}
}
catch(Exception e) {
e.getStackTrace();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment