Problem with relative file path

后端 未结 6 1908
旧时难觅i
旧时难觅i 2021-01-01 22:31

So here is my program, which works ok:

import java.io.FileReader;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Scanner;
import         


        
6条回答
  •  天涯浪人
    2021-01-01 23:21

    From which directory is the class file executed? (That would be the current working directory and base directory for relative paths.)

    If you simply launch the application from eclipse, the project directory will be the working directory, and you should in that case use "bin/usnumbers.txt".

提交回复
热议问题