how to read text file relative path

后端 未结 4 2197
迷失自我
迷失自我 2021-02-20 01:57

I have read sources here & there, but did not get the following code working. Basically, I wish to read a text file, named \'Administrator\' from the folder \'src\'. I will

4条回答
  •  一向
    一向 (楼主)
    2021-02-20 02:33

    In almost all cases you should use the portable forward slash "/"." In every case you should use either the File constructor that accepts a File (parent) & String (file name) or use System.getProperty("file.separator").

提交回复
热议问题