java.io.FileNotFoundException: the system cannot find the file specified

前端 未结 8 1570
Happy的楠姐
Happy的楠姐 2020-11-22 15:27

I have a file named \"word.txt\".

It is in the same directory as my java file.

But when I try to access it in the following code th

8条回答
  •  Happy的楠姐
    2020-11-22 15:50

    Try to create a file using the code, so you will get to know the path of the file where the system create

    File test=new File("check.txt");
    if (test.createNewFile()) {
        System.out.println("File created: " + test.getName());
      }
    

提交回复
热议问题