Relative/Absolute Path in Java

前端 未结 2 1028
青春惊慌失措
青春惊慌失措 2021-01-29 14:41

I need to write a program that asks for the file name of a text document of number and then calculates average, median, etc., from this data set. I have written the program so

2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-29 15:19

    Your file should be in the class-path. That's in the same directory that your main class is in.

    The suggested practice is to place it in a Resources directory inside your class-path, then you can access it via, "Resources/inputValues2.txt".

提交回复
热议问题