How to specify filepath in java?

后端 未结 5 1013
礼貌的吻别
礼貌的吻别 2021-01-03 03:38

I have created a java application for \"Debian Linux.\" Now I want that that application reads a file placed in the directory where the jar file of that application is speci

5条回答
  •  死守一世寂寞
    2021-01-03 04:02

    Are you asking about escape character issues?

    If that is the case then use forward slashes instead of backward slashes like

    "C:/Users/You/Desktop/test.txt"

    instead of

    "C:\Users\You\Desktop\test.txt"

提交回复
热议问题