0% completed
import java.io.File;
import java.io.IOException;
public class Test {
public static void main(String[] args) {
try {
File file = new File("data.txt");
if (file.createNewFile()) {
System.out.println("File created successfully.");
} else {
System.out.println("File already exists.");
}
} catch (IOException e) {
System.out.println("Error occurred while creating the file.");
}
}
}
.....
.....
.....