package javaapplication33;
import java.io.File;
import java.io.IOException;
public class JavaApplication33 {
public static void main(String[] args) throws IOException{
File happyFile = new File("/happy.txt");
if (happyFile.exists() == false) {
happyFile.createNewFile();
System.out.println("the file is created");
} else {
System.out.println("tHE FILE ALREADY EXSISTED ");
}
}
}
ここに私のエラーがあります:
Exception in thread "main" java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:883)
at javaapplication33.JavaApplication33.main(JavaApplication33.java:14)
Java 結果: 1
- C:// & C:/ を試してみましたが、それでもうまくいきませんでした*