Java says FileNotFoundException but file exists

前端 未结 10 1374
遇见更好的自我
遇见更好的自我 2020-11-22 10:19

I have an assignment for my CS class where it says to read a file with several test scores and asks me to sum and average them. While summing and averaging is easy, I am hav

10条回答
  •  忘了有多久
    2020-11-22 10:42

    The code itself is working correctly. The problem is, that the program working path is pointing to other place than you think.

    Use this line and see where the path is:

    System.out.println(new File(".").getAbsoluteFile());
    

提交回复
热议问题