Difference between File.separator and slash in paths

后端 未结 14 1423
执笔经年
执笔经年 2020-11-22 13:15

What is the difference between using File.separator and a normal / in a Java Path-String?

In contrast to double backslash \\\\

14条回答
  •  余生分开走
    2020-11-22 13:24

    Although it doesn't make much difference on the way in, it does on the way back.

    Sure you can use either '/' or '\' in new File(String path), but File.getPath() will only give you one of them.

提交回复
热议问题